SetErrorBarColors
Prev | PHPlot Function Reference | Next

## SetErrorBarColors

SetErrorBarColors — Sets the colors used for data error bars

## Synopsis

    $plot->SetErrorBarColors($error_bar_colors)

## Description

`SetErrorBarColors` sets the colors used for each data set's error bars, in the same way SetDataColors sets the colors used for the data plot itself.

## Parameters

`$error_bar_colors`

  An array of color values, one for each data set's error bars. Or, a single color value (not an array) to use for all data set error bars. For other possibilities, see Notes. See Section 3.5, “Colors” for more on color values.

## Notes

If an array is used for `$error_bar_colors`, it must use zero based sequential integer indexes. This is what the PHP manual calls 'the usual integer indices (starting from zero, increasing by one)'.

If `$error_bar_colors` is not an array, but a single color value, then that color will be used for all data sets' error bars. However, the array(r,g,b) notation is not allowed in this case (because it looks like an array of 3 separate color values). You can get around this restriction if you want to specify a single color as an R, G, B array by wrapping the array in another array, for example: `array(array(102, 0, 192))`.

Two special uses of the `$error_bar_colors` argument are available. If the argument is an empty string, or boolean False, the color map is reset to the defaults. This can be used to restore the default color map. If the argument is NULL or missing from the function call, the color map is reset to the defaults, but only if it has not already been set. This is used internal to PHPlot for one-time initialization.

If SetErrorBarColors is never called, the default color map is the same as for SetDataColors. It contains 16 colors, starting with SkyBlue, green, orange, and blue. For the full list, see Section 3.5.3, “Plotting Colors”.

If you change the data colors with SetDataColors, you probably want to change the error bar colors to the same array.

## History

Through PHPlot-5.0.7, the default color map contained these 8 colors: SkyBlue, green, orange, blue, orange, red, violet, and azure1. These were used if SetErrorBarColors was never called. Also, through PHPlot-5.0.7, if SetErrorBarColors was called with an empty string argument, the color map was set to just contain 'black'. Starting with PHPlot-5.1.0, a new default color map with 16 colors was defined. Given an empty string (or False), SetErrorBarColors now restores the default color map.

Prev | Up | Next
SetDrawYGrid | Home | SetErrorBarLineWidth