jsROOT 2d cells displayed only on a click

Dear jsROOT developers

Here is a PNG as well as jsROOT display of a 2d histogram

The jsROOT one has a white cell (top right bin EA6), while the png one (rightly) has this cell painted. If one clicks the cell, jsROOT redraw and paints this cell. This is probably kind of an optimization that jsROOT is doing. But is there anyway to fix this



ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Hi Rohin,

Yes, I copy your JSON and can reproduce problem.
I will try to investigate.


The issue seems to be that the minimal value along the z axis is stored as "fMinimum" : 2.06208729743958, while the minimal value stored in fArray is 2.062087. So indeed the minimum is larger than the minimal value in the histogram according to its description. While fMinimum is a double, for the TH2F that you are using, the fArray contains floats. Most likely the floating point numbers are not stored with the required precision; the floating point numbers seem to be stored with 7 digits (fgFloatFmt is %e in TBufferText.cxx), which according to std::numeric_limits<float>::max_digits10 is not enough to be converted back in a unique way. Similar arguments also apply for double.

The issue seems to be that the minimal value along the z axis is stored as "fMinimum"

Exactly, this is a problem!
Histogram bins values stored as floats, but min/max as double.
Can you just decrease fMinimum by small factor - in such case drawing will work.

Thanks guys for the follow up.

Is there anything that I should do on my side ?. The JSONs for the pad are produced using TBufferJson. So the fix should come from that side ?



You should change minimum value, which is specified in histogram before converting into JSON.
Like h1->SetMinimum(normal_value - 0.00001).

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