This tutorial demonstrates how to set a logarithmic scale for the axes of a graph using the SetLogScale()
method.
The logarithmic scale can be applied to either the x-axis, the y-axis, or both axes at the same time. When using a logarithmic scale, the data must be positive since the logarithm is undefined for non-positive values and zero.
auto c =
new TCanvas(
"c",
"Reversed graphs",0,0,900,400);
}
gr1->SetTitle(
"Graph without log scale");
gr1->SetTitle(
"Graph with y log scale");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
A TGraph is an object made of two arrays X and Y with npoints each.
- Date
- 25/11/2024
- Author
- Emanuele Chiamulera
Definition in file gr110_logscale.C.