root
root copied to clipboard
Canvas is not displayed on secondary cell executions if `Print` method is used
Check duplicate issues.
- [X] Checked for duplicates
Description
TCanvas is not displayed in Jupyter notebook on secondary cell executions if Print method is used in the cell.
| First time cell execution | Secondary cell executions (note the order execution number) |
|---|---|
See discussion here: https://github.com/root-project/root/issues/13631#issuecomment-1941706841
Reproducer
c1 = ROOT.TCanvas("c1","c1",600,400)
c1.Draw()
h1 = ROOT.TH1F("h1","h1",100,-10,10)
h1.FillRandom("gaus",1000)
c1.Print("test.pdf")
ROOT version
6.30/02
Installation method
Arch linux package manager
Operating system
Linux
Additional context
No response
I cannot reproduce problem. Maybe @vepadulano can check.
To get proper drawing, one should do:
h1 = ROOT.TH1F("h1","h1",100,-10,10)
h1.FillRandom("gaus",1000)
c1 = ROOT.TCanvas("c1","c1",600,400)
h1.Draw()
c1.Draw()
c1.Print("test.pdf")
I guess, one can close problem.
%reset -f does not cleanup ROOT, all histograms and canvases remains.
If executing correct macro again, one just get warnings about canvas with same name, but drawing works as expected.
Hi @linev, @vepadulano,
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
Sincerely, :robot:
Issue with drawing new canvas with same name probably was resolved by https://github.com/root-project/root/pull/15943