1 #ifndef SCATTERGRAPH_HH
2 #define SCATTERGRAPH_HH
23 enum Order {ascending, descending};
50 ScatterGraph(
const char *name,
const char *title,
size_t n,
double* x,
double* y,
double* z);
59 void AddPoint(
double x,
double y,
double w=1);
62 void SetPoint(
size_t i,
double x,
double y,
double w=1) {
_graph->SetPoint(i, x, y, w); }
65 void SetPoints(
size_t n,
double* x,
double* y,
double* w);
113 void SetRange(
double minx,
double miny,
double maxx,
double maxy);
TGraph2D * _graph
Underlying TGraph2D object.
Definition: ScatterGraph.hh:132
void Draw()
Draws the scatter plot.
Definition: ScatterGraph.cc:125
void SetMaximum(const double max)
Sets the minimum of the underlying TGraph2D.
Definition: ScatterGraph.hh:110
void SetMinimum(const double min)
Sets the minimum of the underlying TGraph2D.
Definition: ScatterGraph.hh:107
virtual ~ScatterGraph()
Destructor - any member pointers are deleted.
Definition: ScatterGraph.cc:61
void SetTitle(const char *title)
Sets the name of the underlying TGraph2D.
Definition: ScatterGraph.hh:86
TGaxis * _xaxis
Underlying TGaxis object defined for the x axis.
Definition: ScatterGraph.hh:133
void Write()
Save the histogram to the root file.
Definition: ScatterGraph.hh:128
virtual const char * GetName() const
Returns the name of the underlying TGraph2D.
Definition: ScatterGraph.hh:83
void SetYaxisTitle(const char *title="")
Sets the title of the y axis.
Definition: ScatterGraph.hh:125
void SetPoints(size_t n, double *x, double *y, double *w)
Sets one of the points to a certain value.
Definition: ScatterGraph.cc:77
void AddPoint(double x, double y, double w=1)
Sets one of the points to a certain value.
Definition: ScatterGraph.cc:71
ScatterGraph()
Default constructor - initialises to 0/NULL.
Definition: ScatterGraph.cc:3
void SetPoint(size_t i, double x, double y, double w=1)
Sets one of the points to a certain value.
Definition: ScatterGraph.hh:62
void SetMarkerStyle(int style)
Sets the marker style of the underlying TGraph2D.
Definition: ScatterGraph.hh:116
void SetName(const char *name)
Sets the name of the underlying TGraph2D.
Definition: ScatterGraph.hh:80
size_t GetN() const
Returns the number of entries in the underlying TGraph2D.
Definition: ScatterGraph.hh:92
virtual const char * GetTitle() const
Returns the title of the underlying TGraph2D.
Definition: ScatterGraph.hh:89
void SetMarkerSize(double size)
Sets the marker size of the underlying TGraph2D.
Definition: ScatterGraph.hh:119
TGaxis * _yaxis
Underlying TGaxis object defined for the y axis.
Definition: ScatterGraph.hh:134
void SetRange(double minx, double miny, double maxx, double maxy)
Sets the limits of the x and y axes.
Definition: ScatterGraph.cc:85
void Save()
Saves the scatter plot.
Definition: ScatterGraph.cc:164
void SetOrder(const Order &order)
Sets the order in which the points are drawn.
Definition: ScatterGraph.cc:91
Defines functions that allow to plot a ROOT scatter graph with a color scale.
Definition: ScatterGraph.hh:31
void SetMaxSize(const size_t &size)
Sets the maximum amount of points to be drawn.
Definition: ScatterGraph.cc:118
ScatterGraph & operator=(const ScatterGraph &scat)
Equality operator - any pointers are deep copied.
Definition: ScatterGraph.cc:44
TAxis * GetZaxis()
Returns a pointer to the y axis, in order to set its attributes.
Definition: ScatterGraph.hh:104
TGaxis * GetYaxis()
Returns a pointer to the y axis, in order to set its attributes.
Definition: ScatterGraph.hh:101
void SetXaxisTitle(const char *title="")
Sets the title of the x axis.
Definition: ScatterGraph.hh:122
TGaxis * GetXaxis()
Returns a pointer to the x axis, in order to set its attributes.
Definition: ScatterGraph.hh:98
TGraph2D * GetGraph2D()
Returns the the underlying TGraph2D.
Definition: ScatterGraph.hh:95