Stwml
June 13, 2020, 6:23am
1
Hi,
I installed ROOT 6 on python 2.7. It works very well. I tested with simple plots, they showed up on screen as I expected. Then, I tried to run a simple test on python by creating the file.py, it worked as well. When I plotted a histogram with python (Filetest.py). The canvas pops up on my screen but it showed nothing. Do you have any experience with it? How should I fix it?
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.23
Platform: Not Provided
Compiler: Not Provided
Welcome to the forum!
Stwml:
How should I fix it?
It really depends on what is in your script. And you forgot to tell which platform you’re working on
Stwml
June 13, 2020, 12:49pm
3
Thanks for replying.
Sorry to forget to tell a platform. I am using a macOS Catalina.
The script just simple test ::
from ROOT import *
his = TH1F(“his”, “histogram”, 100, -5, 5)
his.FillRandom(“gause”,10000)
his.Draw()
raw_input()
Try:
from ROOT import TH1F, gPad, gSystem
his = TH1F("his", "histogram", 100, -5, 5)
his.FillRandom("gaus",10000)
his.Draw()
# gPad.Modified(); gPad.Update() # maybe
gSystem.ProcessEvents() # 1
gSystem.ProcessEvents() # 2 (maybe)
raw_input()
Stwml
June 13, 2020, 1:37pm
5
Thanks so much. It works now. How “gSystem.ProcessEvents()” work and why I have to do it twice?
Maybe calling it once will be sufficient (sometimes two calls are required ).
system
Closed
June 27, 2020, 3:33pm
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.