I’ve noticed when using a TGraph spanning many orders of magnitude that the zoom for the output depends on the order of setting the log-axis. If one sets the x-axis to log first the y-axis values are truncated to three orders of magnitude. While setting the y-axis to log first displays the entire range of data. This is displayed below:
I see the same thing with the ROOT master. Surely a different path is taken in both cases. ROOT attempt to set the Log scale on plot having a Y value Thanks to have reported this problem. A workaround is:
TGraph *g1 = new TGraph(numPoints, xValues, yValues);
g1->GetHistogram()->SetMinimum(0.001);
TGraph *g2 = new TGraph(numPoints, xValues, yValues);
g1->GetHistogram()->SetMinimum(0.001);
Yes … no need to specify the intermediate histogram.
If the minimum is negative the Log scale along Y will be invalid anyway and ROOT will try to find a suitable minimal value as long as the maximum is positive. If the maximum is negative also ROOT will complain that it cannot display the graph.
I think this issue should be fixed. The order off setting the log scale should not have any effect on the display. Can you submit a bug report in Jira ?