ROOT 6.10/09 Reference Guide |
Marker Attributes class.
This class is used (in general by secondary inheritance) by many other classes (graphics, histograms). It holds all the markers attributes.
The marker attributes are:
The marker color is a color index (integer) pointing in the ROOT color table. The marker color of any class inheriting from TAttMarker
can be changed using the method SetMarkerColor
and retrieved using the method GetMarkerColor
. The following table shows the first 50 default colors.
SetMarkerColorAlpha()
, allows to set a transparent color. In the following example the marker color of the histogram histo
is set to blue with a transparency of 35%. The color kBlue
itself remains fully opaque.
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.
The Marker style defines the markers' shape. The marker style of any class inheriting from TAttMarker
can be changed using the method SetMarkerStyle
and retrieved using the method GetMarkerStyle
.
The following list gives the currently supported markers (screen and PostScript) style. Each marker style is identified by an integer number (first column) corresponding to a marker shape (second column) and can be also accessed via a global name (third column).
Various marker sizes are shown in the figure below. The default marker size=1 is shown in the top left corner. Marker sizes smaller than 1 can be specified. The marker size does not refer to any coordinate systems, it is an absolute value. Therefore the marker size is not affected by any change in TPad's scale. A marker size equal to 1 correspond to 8 pixels. That is, a square marker with size 1 will be drawn with a side equal to 8 pixels on the screen.
The marker size of any class inheriting from TAttMarker
can be changed using the method SetMarkerSize
and retrieved using the method GetMarkerSize
.
Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. They are meant to be very fast to draw and are always drawn with the same number of pixels; therefore SetMarkerSize
does not apply on them. To have a "scalable dot" a filled circle should be used instead, i.e. the marker style number 20. By default (if SetMarkerStyle
is not specified), the marker style used is 1. That's the most common one to draw scatter plots.
Definition at line 19 of file TAttMarker.h.
Public Member Functions | |
TAttMarker () | |
TAttMarker default constructor. More... | |
TAttMarker (Color_t color, Style_t style, Size_t msize) | |
TAttMarker normal constructor. More... | |
virtual | ~TAttMarker () |
TAttMarker destructor. More... | |
void | Copy (TAttMarker &attmarker) const |
Copy this marker attributes to a new TAttMarker. More... | |
virtual Color_t | GetMarkerColor () const |
Return the marker color. More... | |
virtual Size_t | GetMarkerSize () const |
Return the marker size. More... | |
virtual Style_t | GetMarkerStyle () const |
Return the marker style. More... | |
virtual void | Modify () |
Change current marker attributes if necessary. More... | |
virtual void | ResetAttMarker (Option_t *toption="") |
Reset this marker attributes to the default values. More... | |
virtual void | SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1) |
Save line attributes as C++ statement(s) on output stream out. More... | |
virtual void | SetMarkerAttributes () |
Invoke the DialogCanvas Marker attributes. More... | |
virtual void | SetMarkerColor (Color_t mcolor=1) |
Set the marker color. More... | |
virtual void | SetMarkerColorAlpha (Color_t mcolor, Float_t malpha) |
Set a transparent marker color. More... | |
virtual void | SetMarkerSize (Size_t msize=1) |
Set the marker size. More... | |
virtual void | SetMarkerStyle (Style_t mstyle=1) |
Set the marker style. More... | |
Protected Attributes | |
Color_t | fMarkerColor |
Marker color. More... | |
Size_t | fMarkerSize |
Marker size. More... | |
Style_t | fMarkerStyle |
Marker style. More... | |
#include <TAttMarker.h>
TAttMarker::TAttMarker | ( | ) |
TAttMarker default constructor.
Default text attributes are taking from the current style.
Definition at line 176 of file TAttMarker.cxx.
TAttMarker normal constructor.
Text attributes are taking from the argument list
Definition at line 192 of file TAttMarker.cxx.
|
virtual |
TAttMarker destructor.
Definition at line 202 of file TAttMarker.cxx.
void TAttMarker::Copy | ( | TAttMarker & | attmarker | ) | const |
Copy this marker attributes to a new TAttMarker.
Definition at line 209 of file TAttMarker.cxx.
|
inlinevirtual |
Return the marker color.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 31 of file TAttMarker.h.
|
inlinevirtual |
Return the marker size.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 33 of file TAttMarker.h.
|
inlinevirtual |
Return the marker style.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 32 of file TAttMarker.h.
|
virtual |
Change current marker attributes if necessary.
Definition at line 219 of file TAttMarker.cxx.
Reset this marker attributes to the default values.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 234 of file TAttMarker.cxx.
|
virtual |
Save line attributes as C++ statement(s) on output stream out.
Definition at line 244 of file TAttMarker.cxx.
|
virtual |
Invoke the DialogCanvas Marker attributes.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 264 of file TAttMarker.cxx.
Set the marker color.
Reimplemented in TGX11, TGWin32, TEveTrackList, TVirtualX, TEvePointSetArray, TPostScript, TGWin32VirtualXProxy, TPDF, TEvePointSet, TTeXDump, TGQuartz, TSVG, and TEveLine.
Definition at line 38 of file TAttMarker.h.
Set a transparent marker color.
malpha defines the percentage of the color opacity from 0. (fully transparent) to 1. (fully opaque).
Definition at line 273 of file TAttMarker.cxx.
Set the marker size.
Reimplemented in TGX11, TGWin32, TEveTrackList, TVirtualX, TEvePointSetArray, TGWin32VirtualXProxy, TEvePointSet, TTeXDump, and TGQuartz.
Definition at line 41 of file TAttMarker.h.
Set the marker style.
Reimplemented in TGX11, TGWin32, TEveTrackList, TVirtualX, TEvePointSetArray, TGWin32VirtualXProxy, TEvePointSet, and TGQuartz.
Definition at line 40 of file TAttMarker.h.
|
protected |
Marker color.
Definition at line 22 of file TAttMarker.h.
|
protected |
Marker size.
Definition at line 24 of file TAttMarker.h.
|
protected |
Marker style.
Definition at line 23 of file TAttMarker.h.