Logo ROOT  
Reference Guide
No Matches
candlescaled.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Candle Scaled, illustrates what scaling does on candle and violin charts.

Please try to modify the static functions SetScaledCandle and SetScaledViolin

void candlescaled()
TCanvas *c1 = new TCanvas("c1","TCandle Scaled",800,600);
TH2I *h1 = new TH2I("h1","GausXY",20,-5,5,100,-5,5);
TH2I *h3 = new TH2I("h3","GausXY",100,-5,5,20,-5,5);
for (int j = 0; j < 100000; j++) {
auto myRand1 = gRandom->Gaus(0,1);
auto myRand2 = gRandom->Gaus(0,1);
h1->Fill(myRand1, myRand2);
h3->Fill(myRand1, myRand2);
TCandle::SetScaledCandle(true); /* This is a global option for all existing candles, default is false */
h1->SetTitle("CandleX scaled");
h3->SetTitle("CandleY scaled");
TCandle::SetScaledViolin(false); /* This is a global option for all existing violin, default is true */
TH2I *h2 = (TH2I*)h1->Clone();
TH2I *h4 = (TH2I*)h3->Clone();
h2->SetTitle("ViolinX unscaled");
h4->SetTitle("ViolinY unscaled");
@ kGray
Definition Rtypes.h:65
@ kBlue
Definition Rtypes.h:66
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:39
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
static void SetScaledViolin(const Bool_t vScale=true)
Static function to set scaling between violin-withs.
Definition TCandle.cxx:235
static void SetScaledCandle(const Bool_t cScale=true)
Static function to set scaling between candles-withs.
Definition TCandle.cxx:225
The Canvas class.
Definition TCanvas.h:23
void SetTitle(const char *title) override
Change/set the title.
Definition TH1.cxx:6667
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3325
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
Definition TH1.cxx:3094
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2733
2-D histogram with an int per channel (see TH1 documentation)}
Definition TH2.h:217
Int_t Fill(Double_t) override
Invalid Fill method.
Definition TH2.cxx:347
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition TRandom.cxx:274
return c1
Definition legend1.C:41
TH1F * h1
Definition legend1.C:5
Georg Troska

Definition in file candlescaled.C.