void logscales()
{
TCanvas *
c1 =
new TCanvas(
"c1",
"Various options on LOG scales plots", 0, 0, 700, 900);
TPad *pad1 =
new TPad(
"pad1",
"pad1", 0.03, 0.62, 0.50, 0.92, 32);
TPad *pad2 =
new TPad(
"pad2",
"pad2", 0.51, 0.62, 0.98, 0.92, 33);
TPad *pad3 =
new TPad(
"pad3",
"pad3", 0.03, 0.02, 0.97, 0.535, 38);
title->SetFillColor(16);
title->SetTextFont(42);
title->Draw();
pave->
AddText(
"When more Log labels are requested, the overlapping labels are removed");
TF1 *
f1 =
new TF1(
"f1",
"x*sin(x)*exp(-0.1*x)+15", -10., 10.);
TF1 *f2 =
new TF1(
"f2",
"(sin(x)+cos(x))**5+15", -10., 10.);
TF1 *f3 =
new TF1(
"f3",
"(sin(x)/(x)-x*cos(x))+15", -10., 10.);
f1->GetYaxis()->SetMoreLogLabels();
pave1->
AddText(
"Log scale along Y axis.");
pave1->
AddText(
"More Log labels requested.");
double x[10] = {200, 300, 400, 500, 600, 650, 700, 710, 900, 1000};
double y[10] = {200, 1000, 900, 400, 500, 250, 800, 150, 201, 220};
pave2->
AddText(
"Log scale along X and Y axis.");
pave2->
AddText(
"More Log labels on both.");
pave2->
AddText(
"No exponent along Y axis.");
TF1 *f4 =
new TF1(
"f4a",
"x*sin(x+10)+25", 1, 21);
f4 =
new TF1(
"f4b",
"x*cos(x+10)*sin(x+10)+25", 1, 21);
for (
int i =
a; i >= 1; i--) {
f4 =
new TF1(
Form(
"f4b_%d", i),
"x*sin(x+10)*[0]/[1]+25", 1, 21);
f4 =
new TF1(
Form(
"f4c_%d", i),
"x*cos(x+10)*sin(x+10)*[0]/[1]+25", 1, 25);
}
pave3->
AddText(
"Log scale along X and Y axis.");
pave3->
AddText(
"More Log labels on both.");
pave3->
AddText(
"The labels have no exponents (they would be 0 or 1)");
}
int Int_t
Signed integer 4 bytes (int).
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
void SetMoreLogLabels(Bool_t more=kTRUE)
Set the kMoreLogLabels bit flag When this option is selected more labels are drawn when in log scale ...
void SetNoExponent(Bool_t noExponent=kTRUE)
Set the NoExponent flag By default, an exponent of the form 10^N is used when the label value are eit...
virtual void SetNpx(Int_t npx=100)
void Draw(Option_t *option="") override
Default Draw method for all objects.
virtual void SetParameter(Int_t param, Double_t value)
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
The most important graphics class in the ROOT system.
void SetGridx(Int_t value=1) override
void SetLogy(Int_t value=1) override
Set Lin/Log scale for Y.
void SetGridy(Int_t value=1) override
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
void SetLogx(Int_t value=1) override
Set Lin/Log scale for X.
A Pave (see TPave) with a text centered in the Pave.
void Draw(Option_t *option="") override
Draw this pave with its current attributes.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)