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 an opacity of 35% (i.e. a transparency of 65%). (The color kBlue
itself is internally stored as fully opaque.)
The transparency is available on all platforms when the flag OpenGL.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, TeX ... but not PostScript.
Alternatively, you can call at the top of your script gSytle->SetCanvasPreferGL();
. Or if you prefer to activate GL for a single canvas c
, then use c->SetSupportGL(true);
.
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).
The line width of a marker is not actually a marker attribute since it does only apply to open marker symbols and marker symbols consisting of lines. All of these marker symbols are redefined with thicker lines by style numbers starting from 50:
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. | |
TAttMarker (Color_t color, Style_t style, Size_t msize) | |
TAttMarker normal constructor. | |
virtual | ~TAttMarker () |
TAttMarker destructor. | |
void | Copy (TAttMarker &attmarker) const |
Copy this marker attributes to a new TAttMarker. | |
virtual Color_t | GetMarkerColor () const |
Return the marker color. | |
virtual Size_t | GetMarkerSize () const |
Return the marker size. | |
virtual Style_t | GetMarkerStyle () const |
Return the marker style. | |
virtual TClass * | IsA () const |
virtual void | Modify () |
Change current marker attributes if necessary. | |
virtual void | ResetAttMarker (Option_t *toption="") |
Reset this marker attributes to the default values. | |
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. | |
virtual void | SetMarkerAttributes () |
Invoke the DialogCanvas Marker attributes. | |
virtual void | SetMarkerColor (Color_t mcolor=1) |
Set the marker color. | |
virtual void | SetMarkerColorAlpha (Color_t mcolor, Float_t malpha) |
Set a transparent marker color. | |
virtual void | SetMarkerSize (Size_t msize=1) |
Set the marker size. | |
virtual void | SetMarkerStyle (Style_t mstyle=1) |
Set the marker style. | |
virtual void | Streamer (TBuffer &) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
static Width_t | GetMarkerLineWidth (Style_t style) |
Internal helper function that returns the line width of the given marker style (0 = filled marker) | |
static Style_t | GetMarkerStyleBase (Style_t style) |
Internal helper function that returns the corresponding marker style with line width 1 for the given style. | |
Protected Attributes | |
Color_t | fMarkerColor |
Marker color. | |
Size_t | fMarkerSize |
Marker size. | |
Style_t | fMarkerStyle |
Marker style. | |
#include <TAttMarker.h>
TAttMarker::TAttMarker | ( | ) |
TAttMarker default constructor.
Default text attributes are taking from the current style.
Definition at line 211 of file TAttMarker.cxx.
TAttMarker normal constructor.
Text attributes are taking from the argument list
Definition at line 227 of file TAttMarker.cxx.
|
virtual |
TAttMarker destructor.
Definition at line 237 of file TAttMarker.cxx.
|
static |
|
inlinestaticconstexpr |
Definition at line 50 of file TAttMarker.h.
void TAttMarker::Copy | ( | TAttMarker & | attmarker | ) | const |
Copy this marker attributes to a new TAttMarker.
Definition at line 244 of file TAttMarker.cxx.
|
inlinestatic |
Definition at line 50 of file TAttMarker.h.
|
inlinevirtual |
Return the marker color.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 31 of file TAttMarker.h.
Internal helper function that returns the line width of the given marker style (0 = filled marker)
Definition at line 306 of file TAttMarker.cxx.
|
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.
Internal helper function that returns the corresponding marker style with line width 1 for the given style.
Definition at line 255 of file TAttMarker.cxx.
|
inlinevirtual |
Reimplemented in ROOT::Experimental::XRooFit::xRooHypoSpace, TMVA::TSpline1, TMVA::TSpline2, TStyle, TVirtualPS, TVirtualX, TGeoBatemanSol, TVirtualGeoTrack, TGCocoa, TGQuartz, TCandle, TCutG, TGraphPolar, TGraphQQ, TLegendEntry, TMarker, TImageDump, TPDF, TPostScript, TSVG, TTeXDump, TGWin32, TGX11, TGX11TTF, TEveLine, TEveLineProjected, TEvePointSet, TEvePointSetArray, TEvePointSetProjected, TEveScalableStraightLineSet, TEveStraightLineSet, TEveStraightLineSetProjected, TEveTrack, TEveTrackList, TEveTrackProjected, TEveTrackListProjected, TPointSet3D, TPolyMarker3D, TGLTH3Composition, TWebPadPainter, TWebPS, THbookTree, TEfficiency, TF1, TF12, TF2, TF3, TGraph, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraphAsymmErrors, TGraphBentErrors, TGraphErrors, TGraphMultiErrors, TH1, TH1C, TH1S, TH1I, TH1L, TH1F, TH1D, TH1K, TH2, TH2C, TH2S, TH2I, TH2L, TH2F, TH2D, TH2Poly, TH3, TH3C, TH3S, TH3I, TH3L, TH3F, TH3D, TPolyMarker, TProfile, TProfile2D, TProfile2Poly, TProfile3D, TScatter, TSpline, TSpline3, TSpline5, ROOT::v5::TF1Data, TProofChain, RooCurve, RooEllipse, RooHist, TChain, TNtuple, TNtupleD, TTree, and TTreeSQL.
Definition at line 50 of file TAttMarker.h.
|
virtual |
Change current marker attributes if necessary.
Definition at line 323 of file TAttMarker.cxx.
|
virtual |
Reset this marker attributes to the default values.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 338 of file TAttMarker.cxx.
|
virtual |
Save line attributes as C++ statement(s) on output stream out.
Definition at line 348 of file TAttMarker.cxx.
|
virtual |
Invoke the DialogCanvas Marker attributes.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 367 of file TAttMarker.cxx.
|
inlinevirtual |
Set the marker color.
Reimplemented in TEveTrackList, ROOT::Experimental::REveTrackList, TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSVG, TTeXDump, TEveLine, TEvePointSet, ROOT::Experimental::REveLine, ROOT::Experimental::REvePointSet, TEvePointSetArray, and ROOT::Experimental::REvePointSetArray.
Definition at line 38 of file TAttMarker.h.
Set a transparent marker color.
mcolor | defines the marker color |
malpha | defines the percentage of opacity from 0. (fully transparent) to 1. (fully opaque). |
Definition at line 378 of file TAttMarker.cxx.
|
inlinevirtual |
Set the marker size.
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 this method does not apply on them.
Reimplemented in TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TTeXDump, TEvePointSet, TEvePointSetArray, ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, TEveTrackList, and ROOT::Experimental::REveTrackList.
Definition at line 45 of file TAttMarker.h.
|
inlinevirtual |
Set the marker style.
Reimplemented in TVirtualX, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TEvePointSet, TEvePointSetArray, ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, TEveTrackList, and ROOT::Experimental::REveTrackList.
Definition at line 40 of file TAttMarker.h.
|
virtual |
Reimplemented in ROOT::Experimental::XRooFit::xRooHypoSpace, TMVA::TSpline1, TMVA::TSpline2, TStyle, TVirtualPS, TVirtualX, TGeoBatemanSol, TVirtualGeoTrack, TGCocoa, TGQuartz, TCandle, TCutG, TGraphPolar, TGraphQQ, TLegendEntry, TMarker, TImageDump, TPDF, TPostScript, TSVG, TTeXDump, TGWin32, TGX11, TGX11TTF, TEveLine, TEveLineProjected, TEvePointSet, TEvePointSetArray, TEvePointSetProjected, TEveScalableStraightLineSet, TEveStraightLineSet, TEveStraightLineSetProjected, TEveTrack, TEveTrackList, TEveTrackProjected, TEveTrackListProjected, TPointSet3D, TPolyMarker3D, TGLTH3Composition, TWebPadPainter, TWebPS, THbookTree, TEfficiency, TF1, TF12, TF2, TF3, TGraph, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraphAsymmErrors, TGraphBentErrors, TGraphErrors, TGraphMultiErrors, TH1, TH1C, TH1S, TH1I, TH1L, TH1F, TH1D, TH1K, TH2, TH2C, TH2S, TH2I, TH2L, TH2F, TH2D, TH2Poly, TH3, TH3C, TH3S, TH3I, TH3L, TH3F, TH3D, TPolyMarker, TProfile, TProfile2D, TProfile2Poly, TProfile3D, TScatter, TSpline, TSpline3, TSpline5, ROOT::v5::TF1Data, TProofChain, RooCurve, RooEllipse, RooHist, TChain, TNtuple, TNtupleD, TTree, and TTreeSQL.
|
inline |
Definition at line 50 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.