Cut log-y axes in JSROOT

I have some TProfile histograms with the y-axis spanning 6 orders of magnitude or so.
I can see the whole contents when I draw them with “log-y” in the standard ROOT (in a standard TCanvas).
But when I draw them in “JSROOT” with “log-y”, the axes are “cut” to 1 to 4 orders of magnitude (I then need to click each “Y axis” and “Unzoom” it).
It seems to me that “JSROOT” (“7.5.4” and “dev”) erratically tries to optimize the “log-y” ranges.
How can I force it to stay away from them?

You always can do SetMinimum()/SetMaximum() to fix Y range in the histogram.

Can you provide TProfile which makes a problem for you - I will try to check that is wrong

I get a complete ROOT file with various canvases, each with several pads where these histograms are drawn (with “log-y”).
When I open this file in the standard ROOT, everything is fine when I draw these canvases (e.g., in the standard TBrowser). I just need a way to punch the JSROOT not to try to be too clever.

Please attach file here.

Actually I can reproduce problem with simple TProfile example:

https://jsroot.gsi.de/latest/?file=../files/hsimple.root&item=hprof;1&opt=logy

I will try to improve it

Note that you get 2 orders more than needed (below actual data), while I get 4 orders too few (the values of the data are gone from the plot):
y-axis 5e-2 to 20 for the actual data 1e-6 to 2e-1
y-axis 1 to 10 for the actual data 10 to 4e5

Now should be better:

https://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=hprof;1&opt=logy

It will be released soon as version 7.6.0

I tried your “dev”, no change for my plots.

In your canvas there are custom values in pad ranges - probably from previous drawings.
JSROOT tries to use them - and produces wrong result.

In this aspect JSROOT behaves differently from plain ROOT.
I need to change this behavior - but it will takes some time and I will do it after 7.6.0 release.

Well, my plots come from a running DAQ, so they are “updated” at regular intervals (it is then possible that some initial ranges are automatically set at startup).

When you change this behavior, please check that all types of plots are handled (i.e., not just the TProfile, where we noticed it).

Your today’s (2024.03.12) commits fix this problem. Many thanks.

1 Like