ROOT  6.06/09
Reference Guide
Public Member Functions | Protected Attributes | List of all members
TAttMarker Class Reference

Marker Attributes class.

This class is used (in general by secondary inheritance) by many other classes (graphics, histograms). It holds all the markers attributes.

Marker attributes

The marker attributes are:

Marker color

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.

TAttMarker_001.png

Color transparency

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.

histo->SetMarkerColorAlpha(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.

Marker style

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).

Marker number Marker shape Marker name
2 + kPlus
3 * kStar
4 o kCircle
8 large scalable dot kFullDotLarge
9 -->19 large scalable dot
20 full circle kFullCircle
24 open circle kOpenCircle
27 open diamond kOpenDiamond
29 full star kFullStar
30 open star kOpenStar
31 *
33 full diamond kFullDiamond
34 full cross kFullCross
TAttMarker_002.png

Marker size

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.

TAttMarker_003.png

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 32 of file TAttMarker.h.

Public Member Functions

 TAttMarker ()
 
 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
 
virtual Style_t GetMarkerStyle () const
 
virtual Size_t GetMarkerSize () const
 
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)
 
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
 Set a transparent marker color. More...
 
virtual void SetMarkerStyle (Style_t mstyle=1)
 
virtual void SetMarkerSize (Size_t msize=1)
 
 ClassDef (TAttMarker, 2)
 

Protected Attributes

Color_t fMarkerColor
 
Style_t fMarkerStyle
 
Size_t fMarkerSize
 

#include <TAttMarker.h>

+ Inheritance diagram for TAttMarker:

Constructor & Destructor Documentation

TAttMarker::TAttMarker ( )
TAttMarker::TAttMarker ( Color_t  color,
Style_t  style,
Size_t  msize 
)

TAttMarker normal constructor.

Text attributes are taking from the argument list

  • color : Marker Color Index
  • style : Marker style (from 1 to 30)
  • size : marker size (float)

Definition at line 174 of file TAttMarker.cxx.

TAttMarker::~TAttMarker ( )
virtual

TAttMarker destructor.

Definition at line 184 of file TAttMarker.cxx.

Member Function Documentation

TAttMarker::ClassDef ( TAttMarker  ,
 
)
void TAttMarker::Copy ( TAttMarker attmarker) const
virtual Color_t TAttMarker::GetMarkerColor ( ) const
inlinevirtual
virtual Size_t TAttMarker::GetMarkerSize ( ) const
inlinevirtual
virtual Style_t TAttMarker::GetMarkerStyle ( ) const
inlinevirtual

Reimplemented in TGWin32VirtualXProxy.

Definition at line 45 of file TAttMarker.h.

Referenced by TSelectorDraw::Begin(), TPolyMarker3D::Copy(), ROOT::Internal::TBranchProxyDirector::CreateHistogram(), TF2::CreateHistogram(), TF1::DoCreateHistogram(), TAttMarkerEditor::DoMarkerSize(), TH2::DoProfile(), TH3::DoProject1D(), TH3::DoProject2D(), TH2::DoProjection(), TGeoPainter::DrawBatemanSol(), TGQuartz::DrawPolyMarker(), TPolyMarker3D::DrawPolyMarker(), TProofChain::FillDrawAttributes(), TProofDrawHist::Init(), TSpline::Paint(), TF2::Paint(), TGraph2D::Paint(), THistPainter::PaintCandlePlot(), THistPainter::PaintErrors(), TGraphPainter::PaintGraphAsymmErrors(), TGraphPainter::PaintGraphBentErrors(), TGraphPainter::PaintGraphErrors(), TPolyMarker3D::PaintH3(), THistPainter::PaintHist(), TGraph2DPainter::PaintPolyMarker(), TGraph2DPainter::PaintPolyMarker0(), TGraph2DPainter::PaintTriangles_new(), TGraph2DPainter::PaintTriangles_old(), THistPainter::PaintViolinPlot(), TMarker::Print(), TGLUtil::RenderCrosses(), TGLUtil::RenderPoints(), TGLUtil::RenderPolyMarkers(), TPolyMarker3D::SavePrimitive(), TF2::SavePrimitive(), TStyle::SavePrimitive(), TF1::SavePrimitive(), TEveTrack::SetAttLineAttMarker(), TProofDraw::SetDrawAtt(), TEvePointSetArray::SetMarkerStyle(), TEveTrackList::SetMarkerStyle(), TAttMarkerEditor::SetModel(), TSelectorDraw::TakeAction(), TSelectorDraw::TakeEstimate(), TCreatePrimitives::Text(), TTree::TTree(), TStyleManager::UpdateEditor(), TGraph::UseCurrentStyle(), TH1::UseCurrentStyle(), and TTree::UseCurrentStyle().

void TAttMarker::Modify ( )
virtual
void TAttMarker::ResetAttMarker ( Option_t toption = "")
virtual

Reset this marker attributes to the default values.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 216 of file TAttMarker.cxx.

Referenced by TStyle::Reset().

void TAttMarker::SaveMarkerAttributes ( std::ostream &  out,
const char *  name,
Int_t  coldef = 1,
Int_t  stydef = 1,
Int_t  sizdef = 1 
)
virtual
void TAttMarker::SetMarkerAttributes ( )
virtual

Invoke the DialogCanvas Marker attributes.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 246 of file TAttMarker.cxx.

Referenced by TLegend::EditEntryAttMarker(), and RooPlot::SetMarkerAttributes().

virtual void TAttMarker::SetMarkerColor ( Color_t  mcolor = 1)
inlinevirtual

Reimplemented in TGWin32, TGX11, TEveTrackList, TVirtualX, TPostScript, TEvePointSetArray, TGWin32VirtualXProxy, TPDF, TEvePointSet, TTeXDump, TSVG, TGQuartz, and TEveLine.

Definition at line 51 of file TAttMarker.h.

Referenced by RooStats::SamplingDistPlot::AddSamplingDistribution(), ApplicationWindow::ApplicationWindow(), TMVA::bdtcontrolplots(), TSelectorDraw::Begin(), TMVA::boostcontrolplots(), TProofBenchRunCPU::BuildHistos(), TProofBenchRunDataRead::BuildHistos(), TGeoChecker::CheckBoundaryReference(), TGeoChecker::CheckGeometry(), TGeoChecker::CheckPoint(), TMVA::correlations(), TMVA::correlationscatters(), TMVA::correlationscattersMultiClass(), TMVA::correlationsMultiClass(), TMVA::DataSetInfo::CreateCorrelationMatrixHist(), TF2::CreateHistogram(), TF1::DoCreateHistogram(), TAttMarkerEditor::DoLiveAlpha(), TAttMarkerEditor::DoMarkerAlphaColor(), TAttMarkerEditor::DoMarkerColor(), TProofProgressMemoryPlot::DoPlot(), TProofProgressDialog::DoPlotRateGraph(), TH2::DoProfile(), TH3::DoProject1D(), TH3::DoProject2D(), TH2::DoProjection(), RooStats::HypoTestInverterPlot::Draw(), RooStats::LikelihoodIntervalPlot::Draw(), TMultiLayerPerceptron::Draw(), TGeoPainter::DrawBatemanSol(), RooStats::MCMCIntervalPlot::DrawChainScatter(), TProofBench::DrawCPU(), TGeoPainter::DrawCurrentPoint(), DrawData(), TProofBench::DrawDataSet(), TProofBench::DrawEfficiency(), TGeoPainter::DrawPolygon(), interpolate(), TMVA::likelihoodrefs(), TStyleManager::ModMarkerColor(), TMVA::MethodBoost::MonitorBoost(), TMVA::mvas(), TMVA::mvaweights(), TSpline::Paint(), TPolyLineShape::Paint(), TF2::Paint(), TGraph2D::Paint(), TPolyMarker3D::PaintH3(), THistPainter::PaintHist(), TGraph2DPainter::PaintPolyMarker(), TGraph2DPainter::PaintPolyMarker0(), TGraph2DPainter::PaintTriangles_new(), TGraph2DPainter::PaintTriangles_old(), piRandom(), RooAbsData::plotOn(), RooFitResult::plotOn(), RooDataSet::plotOnXY(), TMVA::probas(), TGeoChecker::RandomPoints(), TMVA::regression_averagedevs(), RooUnitTest::runCompTests(), TGeoOverlap::SampleOverlap(), TSpectrum2::Search(), TSpectrum::Search(), TPad::SetAttMarkerPS(), TPolyLineShape::SetColorAttribute(), TProofDraw::SetDrawAtt(), TEveLine::SetMarkerColor(), TGQuartz::SetMarkerColor(), RooStats::SamplingDistPlot::SetMarkerColor(), RooPlot::SetMarkerColor(), TEvePointSetArray::SetMarkerColor(), TGX11::SetMarkerColor(), TVirtualGeoTrack::SetName(), TGeoChecker::ShapeDistances(), TGeoChecker::ShapeNormal(), TGeoChecker::ShapeSafety(), TSelectorDraw::TakeAction(), TSelectorDraw::TakeEstimate(), TProofDrawListOfGraphs::Terminate(), TProofDrawListOfPolyMarkers3D::Terminate(), testInterpolation(), TGeoChecker::TestOverlaps(), TEveTrackPropagator::TEveTrackPropagator(), TGeoOverlap::TGeoOverlap(), TGeoTrack::TGeoTrack(), TTree::TTree(), TGraph::UseCurrentStyle(), TH1::UseCurrentStyle(), and TTree::UseCurrentStyle().

void TAttMarker::SetMarkerColorAlpha ( Color_t  mcolor,
Float_t  malpha 
)
virtual

Set a transparent marker color.

malpha defines the percentage of the color opacity from 0. (fully transparent) to 1. (fully opaque).

Definition at line 255 of file TAttMarker.cxx.

virtual void TAttMarker::SetMarkerSize ( Size_t  msize = 1)
inlinevirtual

Reimplemented in TGWin32, TGX11, TEveTrackList, TVirtualX, TEvePointSetArray, TGWin32VirtualXProxy, TEvePointSet, TTeXDump, and TGQuartz.

Definition at line 54 of file TAttMarker.h.

Referenced by TMVA::bdtcontrolplots(), TSelectorDraw::Begin(), TMVA::boostcontrolplots(), TGeoChecker::CheckBoundaryReference(), TGeoChecker::CheckGeometry(), TGeoChecker::CheckPoint(), TMVA::correlations(), TMVA::correlationscatters(), TMVA::correlationscattersMultiClass(), TMVA::correlationsMultiClass(), TMVA::DataSetInfo::CreateCorrelationMatrixHist(), TF2::CreateHistogram(), TMarker::DisplayMarkerTypes(), TF1::DoCreateHistogram(), doFit(), TAttMarkerEditor::DoMarkerSize(), TProofProgressMemoryPlot::DoPlot(), TProofProgressDialog::DoPlotRateGraph(), TMultiLayerPerceptron::Draw(), TGeoPainter::DrawBatemanSol(), RooStats::MCMCIntervalPlot::DrawChainScatter(), TProofBench::DrawCPU(), TGeoPainter::DrawCurrentPoint(), TProofBench::DrawDataSet(), TProofBench::DrawEfficiency(), TGeoPainter::DrawPolygon(), TMVA::likelihoodrefs(), TStyleManager::ModMarkerSize(), TMVA::mvas(), TMVA::mvaweights(), TSpline::Paint(), TPolyLineShape::Paint(), TF2::Paint(), TGraph2D::Paint(), TPolyMarker3D::PaintH3(), THistPainter::PaintHist(), TGraph2DPainter::PaintPolyMarker(), TGraph2DPainter::PaintPolyMarker0(), TGraph2DPainter::PaintTriangles_new(), TGraph2DPainter::PaintTriangles_old(), piRandom(), RooAbsData::plotOn(), RooDataSet::plotOnXY(), TMVA::probas(), TMVA::regression_averagedevs(), TSpectrum2::Search(), TSpectrum::Search(), TPad::SetAttMarkerPS(), TProofDraw::SetDrawAtt(), TGQuartz::SetMarkerSize(), RooStats::SamplingDistPlot::SetMarkerSize(), TEvePointSet::SetMarkerSize(), RooPlot::SetMarkerSize(), TEvePointSetArray::SetMarkerSize(), TPolyLineShape::SetSizeAttribute(), TMVA::TMVAGlob::SetTMVAStyle(), TGeoChecker::ShapeDistances(), TGeoChecker::ShapeNormal(), TGeoChecker::ShapeSafety(), TSelectorDraw::TakeAction(), TSelectorDraw::TakeEstimate(), TEveTrackPropagator::TEveTrackPropagator(), TGeoTrack::TGeoTrack(), TTree::TTree(), TGraph::UseCurrentStyle(), TH1::UseCurrentStyle(), and TTree::UseCurrentStyle().

virtual void TAttMarker::SetMarkerStyle ( Style_t  mstyle = 1)
inlinevirtual

Reimplemented in TGWin32, TGX11, TEveTrackList, TVirtualX, TEvePointSetArray, TGWin32VirtualXProxy, TEvePointSet, and TGQuartz.

Definition at line 53 of file TAttMarker.h.

Referenced by RooStats::SamplingDistPlot::AddSamplingDistribution(), ApplicationWindow::ApplicationWindow(), TMVA::bdtcontrolplots(), TSelectorDraw::Begin(), binarySearchTime(), TMVA::boostcontrolplots(), TProofBenchRunCPU::BuildHistos(), TProofBenchRunDataRead::BuildHistos(), TGeoChecker::CheckBoundaryReference(), TGeoChecker::CheckGeometry(), TGeoChecker::CheckGeometryFull(), TGeoChecker::CheckPoint(), TF2::CreateHistogram(), TMarker::DisplayMarkerTypes(), TF1::DoCreateHistogram(), doFit(), TAttMarkerEditor::DoMarkerStyle(), TProofProgressMemoryPlot::DoPlot(), TProofProgressDialog::DoPlotRateGraph(), TH2::DoProfile(), TH3::DoProject1D(), TH3::DoProject2D(), TH2::DoProjection(), RooStats::LikelihoodIntervalPlot::Draw(), TGraph::Draw(), TGeoPainter::DrawBatemanSol(), RooStats::MCMCIntervalPlot::DrawChainScatter(), TProofBench::DrawCPU(), TGeoPainter::DrawCurrentPoint(), DrawData(), TProofBench::DrawDataSet(), TProofBench::DrawEfficiency(), TGeoPainter::DrawPolygon(), TPolyMarker3D::DrawPolyMarker(), RooHist::initialize(), interpolate(), TMVA::likelihoodrefs(), RooStats::HypoTestInverterPlot::MakePlot(), TStyleManager::ModMarkerStyle(), TMVA::mvas(), TSpline::Paint(), TF2::Paint(), TGraph2D::Paint(), THistPainter::PaintCandlePlot(), TGraphPainter::PaintGraph(), TGraphPainter::PaintGrapHist(), TPolyMarker3D::PaintH3(), THistPainter::PaintHist(), TGraph2DPainter::PaintPolyMarker(), TGraph2DPainter::PaintPolyMarker0(), TGraph2DPainter::PaintTriangles_new(), TGraph2DPainter::PaintTriangles_old(), THistPainter::PaintViolinPlot(), piRandom(), RooAbsData::plotOn(), RooDataSet::plotOnXY(), TMVA::probas(), TMVA::regression_averagedevs(), TSpectrum2::Search(), TSpectrum::Search(), TPad::SetAttMarkerPS(), TProofDraw::SetDrawAtt(), TGQuartz::SetMarkerStyle(), RooStats::SamplingDistPlot::SetMarkerStyle(), TEvePointSet::SetMarkerStyle(), RooPlot::SetMarkerStyle(), TEvePointSetArray::SetMarkerStyle(), TPolyMarker3D::SetPolyMarker(), TPolyLineShape::SetStyleAttribute(), TMVA::TMVAGlob::SetTMVAStyle(), TGeoChecker::ShapeDistances(), TGeoChecker::ShapeNormal(), TGeoChecker::ShapeSafety(), simanTSP(), stdsort(), TSelectorDraw::TakeAction(), TSelectorDraw::TakeEstimate(), testInterpolation(), TestSpeed(), TEveTrackPropagator::TEveTrackPropagator(), TGeoOverlap::TGeoOverlap(), TGeoTrack::TGeoTrack(), TPerfStats::TPerfStats(), TPolyMarker3D::TPolyMarker3D(), TTree::TTree(), TGraph::UseCurrentStyle(), TH1::UseCurrentStyle(), and TTree::UseCurrentStyle().

Member Data Documentation

Color_t TAttMarker::fMarkerColor
protected
Size_t TAttMarker::fMarkerSize
protected
Style_t TAttMarker::fMarkerStyle
protected

The documentation for this class was generated from the following files: