Line Attributes class.
This class is used (in general by secondary inheritance) by many other classes (graphics, histograms). It holds all the line attributes.
Line attributes
Line attributes are:
Line Color
The line color is a color index (integer) pointing in the ROOT color table. The line color of any class inheriting from TAttLine
can be changed using the method SetLineColor
and retrieved using the method GetLineColor
. The following table shows the first 50 default colors.
Color transparency
SetLineColorAlpha()
, allows to set a transparent color. In the following example the line color of the histogram histo
is set to blue with a transparency of 35%. The color kBlue
itself remains fully opaque.
histo->SetLineColorAlpha(
kBlue, 0.35);
The transparency is available on all platforms when the flagOpenGL.CanvasPreferGL
is set to 1
in $ROOTSYS/etc/system.rootrc
, or on Mac with the Cocoa backend. On the file output it is visible with PDF, PNG, Gif, JPEG, SVG ... but not PostScript.
Line Width
The line width is expressed in pixel units. The line width of any class inheriting from TAttLine
can be changed using the method SetLineWidth
and retrieved using the method GetLineWidth
. The following picture shows the line widths from 1 to 10 pixels.
Line Style
Line styles are identified via integer numbers. The line style of any class inheriting from TAttLine
can be changed using the method SetLineStyle
and retrieved using the method GetLineStyle
.
The first 10 line styles are predefined as shown on the following picture:
Additional line styles can be defined using TStyle::SetLineStyleString
. For example the line style number 11 can be defined as follow:
R__EXTERN TStyle * gStyle
void SetLineStyleString(Int_t i, const char *text)
Set line style string using the PostScript convention.
Existing line styles (1 to 10) can be redefined using the same method.
Definition at line 18 of file TAttLine.h.