Consider this example:
const float x[3] = {0.0, 1.0, 2.0};
const float y1[3] = {1.0, 1.1, 0.9};
const float y2[3] = {3.0, 0.8, 4.5};
TCanvas * c = new TCanvas;
TGraph * gr1 = new TGraph(3, x, y1);
gr1 -> SetMarkerColor(kRed);
gr1 -> SetMarkerStyle(kCircle);
TGraph * gr2 = new TGraph(3, x, y2);
gr2 -> SetMarkerColor(kGreen);
gr2 -> SetMarkerStyle(kPlus);
gr1 -> Draw("AP");
gr2 -> Draw("PSAME");
The output is:
-
In the drawn axes at least the point (1.0, 0.8) of
gr2
should be shown. Why is it not shown? -
How to best adjust the axes range to accommodate both graphs on the same canvas?
How to force the xaxis to start at -0.2, not 0.0?
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided