On missing styles in drawing plots

Hi ROOTers

Yet another question. Attached are 2 plots. They are styled by the same code, the only difference is that the one with incomplete axes is drawn first during the execution, while the other is drawn second (and the first plot in that execution gets incomplete axes). Question is, why does this happen? My workaround is to draw something as a dummy, but sometimes I forget to do that and it’s rather subtle to notice when staring at many plots.

MWE as attached including the ROOT file and code to produce it. It needs to be compiled because I want it to be as close as the fwk making them.

Cheers,
Afiq


ROOT Version: 6.14.00-bc766 (also observed in 6.12/04 and others I tried)
Platform: x86_64-slc6-gcc62-opt
Compiler: GCC 6.2.0


xxx_0.pdf (14.0 KB)

xxx_1.pdf (14.5 KB)

h_covMat.root (32.2 KB)

testroot.cc (4.7 KB)

what do you mean ? the axis look ok …

In the other plot, the axes enclose the entire frame. In the other, only the left and low side have the axes, not the right and up.

Put the style setting first before the canvas creation
setH2Style();
std::unique_ptr can =std::make_unique(“can”, “can”, 200, 10, 1000, 1000);

Cheers,
Minghui.

Keep in mind that the style setting always affects afterwards. So be always put the global style setting first.

Huh, to think that it never occurred to me it’s something so obvious. I wonder what was it that led me to think I should create the canvas first.

Thanks a lot!

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