Canvas doesn't respond in pyROOT


ROOT Version: 6.26.10
Platform: Windows


Hello!
I want to use ROOT in python, and importing pyROOT works. All the commands work as well, except for drawing a histogram, for which the program gives the following line:
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
And is stuck after that. It creates a canvas window as well, which doesn’t respond.

If I run root on the cmd the canvas works perfectly and I can plot histograms on it.

Can someone please help me understand how to fix this problem?

Thank you in advance and have a nice day:)

Welcome to the ROOT Forum!
This is a known issue on Windows. The interactive GUI sessions don’t work in PyROOT.

Hi, thanks!!

Oh that’s a shame, but in principle I don’t need the plot picture in python, I can get it in the cmd easily.

Is there a way to draw the histogram in pyROOT without creating the canvas and making the plot?

Thank you again!!

Sure, you can save your plot in a PDF file and open that PDF afterwards.

Oh that sounds useful!

How can I save the histogram without creating the canvas?

Thank you again!

Edit: Found out how to do it, and it solved the problem. Thank you so much!!!

1 Like

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