I am trying to plot some 2D histogram with COLZ option in Jupyter notebook reading a root file with TChain
Everything works fine, but the final plot, do not show the number of entries in the palette.
``chain = ROOT.TChain(tree)
chain.Add(file.root’)
c2 = ROOT.TCanvas(“c2”, “c2”)
c2.cd()
h2 = ROOT.TH2D(“h2”, “h2”, 20, 0, 20, 20, 0, 20)
chain.Draw(“var1:var2>>h2”)
h2.Sumw2()
h2.Draw(“COLZ”)
c2.Draw()``
_ROOT Version: 6
_Platform: Jupyter Notebook
Compiler: Not Provided
couet
May 23, 2022, 9:08am
2
What do you mean ? can you send a screen dump ?
I mean the number of entries for each color in the palette. Sorry, I was not clear.
couet
May 23, 2022, 9:16am
4
Ah ok. The axis labels.
Try to enlarge the right main of the canvas.
c2 = ROOT.TCanvas("c2", "c2", 700, 500)
Changing “700” to higher values, does not change anything, just the size of the canvas.
But, I am not sure, you mean this.
Oh, it works, thank you a lot. I didn’t find an answer to this anywhere.
Have a good day.
couet
May 23, 2022, 9:29am
8
system
Closed
June 6, 2022, 9:30am
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.