I think this is sort of a bug, but I am not sure.
It is not easy to update histogram’s palette axis title, etc. Please find attached a canvas with a histogram, that has title of Z axis set to “aaa”. If you draw the canvas, no title is drawn near to palette axis and the palette is misplaced. If you redraw the histogram with “colz” options, nothing changes. If you redraw first with no options (Draw()) than with “colz”, title of the Z axis appears and the palette is properly placed.
This is a little bit annoying and one has to know that trick to make it work
pars5_test.root (381 KB)
When I draw your canvas using the latest root trunk on my Mac I get the title on the palette.
With “czer->Draw()”? OK, My version is I guess about one month old trunk, so I’ll recheck.
With the latest trunk the title is drawn properly, but the palette axis is misplaced. Try czer->Draw(), than psf1->Draw(), than psf1->Draw(“colz”) and then the axis is placed correctly. psf1->Draw(“colz”) only does not properly place the palette.
I do not see what is not “correct”. Can you post a picture showing the incorrectness ?
Also, a small script reproducing the problem would be better than explanations.
Yes it looks like when you draw the histogram with an option different than COLZ, the palette size and position are reset.
Shouldn’t it be the default behaviour when redrawing with “colz” or perhaps redrawing the canvas? Otherwise you need to know this trick to redraw the histogram properly after changing the canvas margins, etc.
My recommendation would be to save the histogram in the file. Not the Canvas.
Like that you will not need the artificial step canvas->Draw() just to load the histogram.
Yes, that’s one solution, but sometimes you’ve got a canvas with multiple items. You wan’t just to get the histogram and redraw it in a different circumstances. It is not that rare…