Axis "shifted" in JSROOT

Hi,

Plotting a simple 2D histogram in Browser and in JSROOT does not give the same visual : in JSROOT both axis seems to be a bit “off” (i.e. not aligned to the coloured boxes, see attached figure) and the label angle seems to be interpreted differently…

ROOT Version: 6.24/06
Built for macosx64 on Sep 02 2021, 14:20:23
From tags/v6-24-06@v6-24-06


Can you provide ROOT file with such histogram?

Here’s one
qc-errors.root (6.9 KB)

Problem is modified axis min value.
How it happened that DecodingErrors->GetXaxis()->GetXmin() returns -0.5?
If this value changed to 0.5 for both X and Y axis, this histogram will look in the jsroot like

Even then output is differ from ROOT.
Axis range settings like [0.5 .. nbins+0.5] were used before to center labels on the ticks.
Here is example from old tutorials. But now such axis setting ignored by ROOT.

Can you keep min/max values of axes as is?
ROOT ignores them anyway, but JSROOT will works properly.

Another problem that labels modification is not work yet in JSROOT.
In your case labels angle is differ from default.
But this is another story, which I probably will try to handle

Indeed, using simply axis range [0…nbins] makes the plot look the same in jsroot and ROOT (as far as the alignment of the boxes is concerned, I mean), thanks !

For the labels, ok, I’ll remove my ChangeLabel calls for the moment then. The output is actually quite legible as is, so I can certainly live with it for now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.