98 memcpy(
fColor, col, bufsize);
166 double rwxmin, rwymin, rwxmax, rwymax;
169 double dx = (rwxmax-rwxmin)*
fMargin;
170 double dy = (rwymax-rwymin)*
fMargin;
175 h->SetDirectory(
nullptr);
201 printf(
"x[%d]=%g, y[%d]=%g", i,
X[i], i, Y[i]);
203 if (
fSize) printf(
", size[%d]=%g", i,
fSize[i]);
228 out <<
" " << std::endl;
229 static Int_t frameNumber = 1000;
239 out <<
" Double_t " << fXName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
240 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
X[i] <<
"," << std::endl;
241 out <<
" " <<
X[
fNpoints-1] <<
"};" << std::endl;
242 out <<
" Double_t " << fYName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
243 for (i = 0; i <
fNpoints-1; i++) out <<
" " << Y[i] <<
"," << std::endl;
244 out <<
" " << Y[
fNpoints-1] <<
"};" << std::endl;
245 out <<
" Double_t " << fColorName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
246 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fColor[i] <<
"," << std::endl;
248 out <<
" Double_t " << fSizeName <<
"[" <<
fNpoints <<
"] = {" << std::endl;
249 for (i = 0; i <
fNpoints-1; i++) out <<
" " <<
fSize[i] <<
"," << std::endl;
255 out <<
" TScatter *";
256 out <<
"scat = new TScatter(" <<
fNpoints <<
"," << fXName <<
"," << fYName <<
","
257 << fColorName <<
"," << fSizeName <<
");" << std::endl;
259 out <<
" scat->SetName(" << quote <<
GetName() << quote <<
");" << std::endl;
260 out <<
" scat->SetTitle(" << quote <<
GetTitle() << quote <<
");" << std::endl;
261 out <<
" scat->SetMargin(" <<
GetMargin() <<
");" << std::endl;
262 out <<
" scat->SetMinMarkerSize(" <<
GetMinMarkerSize() <<
");" << std::endl;
263 out <<
" scat->SetMaxMarkerSize(" <<
GetMaxMarkerSize() <<
");" << std::endl;
274 out <<
" " << std::endl;
278 out <<
" scat->Draw(" << quote <<
option << quote <<
");" << std::endl;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
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.
TDirectory::TContext keeps track and restore the current directory.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
@ kNoStats
Don't draw stats box.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
void SetName(const char *name) override
Change the name of this histogram.
2-D histogram with a float per channel (see TH1 documentation)
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
A TScatter is able to draw four variables scatter plot on a single plot.
TGraph * GetGraph() const
Get the graph holding X and Y positions.
Int_t fMaxSize
!Current dimension of arrays fX and fY
Double_t GetMaxMarkerSize() const
Get the largest marker size used to paint the markers.
Double_t fMaxMarkerSize
Largest marker size used to paint the markers.
void Print(Option_t *chopt="") const override
Print graph and errors values.
void Paint(Option_t *chopt="") override
Paint this scatter plot with its current attributes.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
TGraph * fGraph
Pointer to graph holding X and Y positions.
TScatter()
TScatter default constructor.
TH2F * GetHistogram() const
Get the graph histogram used for drawing axis.
Double_t * fColor
[fNpoints] array of colors
~TScatter() override
TScatter default destructor.
void SetMargin(Double_t)
Set the margin around the plot in %.
Double_t GetMinMarkerSize() const
Get the smallest marker size used to paint the markers.
Double_t * fSize
[fNpoints] array of marker sizes
Double_t fMargin
Margin around the plot in %.
Double_t GetMargin() const
Set the margin around the plot in %.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a scatter plot.
Double_t fMinMarkerSize
Smallest marker size used to paint the markers.
Int_t fNpoints
Number of points <= fMaxSize.
TH2F * fHistogram
Pointer to histogram used for drawing axis.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Abstract interface to a histogram painter.
virtual void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py)=0
virtual Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py)=0
virtual void PaintScatter(TScatter *theScatter, Option_t *option)=0
static TVirtualGraphPainter * GetPainter()
Static function returning a pointer to the current graph painter.