I have been creating a 2D histogram of the ratio of 2x2D histograms (h1 and h2) and I draw all 3 onto separate canvases. The plots for h1 and h2 look healthy; however, the z-axis label on the ratio plot (h1/h2) is not consistent with the bin content. I’ve realised that the z-colour scale is correct, it’s only the labels that are wrong. The z-axis labels seem to be coming from histogram h1.
I’ve attached a root file containing h1 and h2 and the sample script (in pyroot) to reproduce the results I see is:
import ROOT as r
r.gROOT.SetBatch(True)
r.gStyle.SetPaintTextFormat(".0f")
f = r.TFile("inputs.root")
h1 = f.Get("h1")
h2 = f.Get("h2")
c = r.TCanvas()
h1.Draw("colztext")
c.SaveAs("h1.pdf")
h2.Draw("colztext")
c.SaveAs("h2.pdf")
r.gStyle.SetPaintTextFormat(".2f")
h3 = h1.Clone("h3")
h3.Divide(h2)
h3.SetMaximum(2.0)
h3.SetMinimum(0.0)
h3.Draw("colztext")
c.SaveAs("h1_h2.pdf")