I would need help setting up custom palette for TH2D histograms in JSROOT. Is there some built-in method for doing this? My issue is that I need to mask bins with empty content (make them appear as white), while non-0 values will follow palette color scheme. Since I have both positive and negative values in the histogram, 0 values (or empty bins) get the middle color from the palette and not white. The palette I would like to achieve looks ideally like this:
thanks, you are right, this is indeed the solution . However, it would still be nice to have possibility to create custom palette. For other plot I struggled to create palette with distinct colors for each integer value. I ended up with setting fContour to list of color limits and choosing palette that have contrasting colors (55). This resulted in something like this:
To configure custom contour levels, you also should set `kUserContour` bit in histogram. Like:
hist.SetBit(1024, true);
For the moment it is not possible to configure fully custom palette from JavaScript side.
Only usecase when custom palette configured in ROOT session and then TCanvas stored in the file - JSROOT able to detect this and will display objects in the TCanvas with such custom palette.
does the trick and fixes first two color issue. Maybe Sergey can explain what does it set exactly and it may be also the solution for the problem @dastudillo solved in the plain ROOT (but it may not work for custom palette, since I am using predefined one).