Can't open TCanvas

_ROOT Version:6.18/04
_Platform:CentOS-7-x86_64
_Compiler:gcc 9.2 (I’m not sure but I install root from epel)

when I open root and type

auto c=new TCanvas("c","c")

Sometimes there is no canvas created. And sometimes there is a new canvas.
Similarly,when I type

auto h1=new TH1F("h1","h1",1000,0,10)
h1->Fill(5)
h1->Draw()

Sometimes there is no canvas created.So what happened. What can I do when this problem occurs

It is weird .

auto c=new TCanvas("c","c")

Should give you a Canvas always.
You are doing this at the ROOT prompt ?
In a macro ?
locally or remotely ?

I do this at the ROOT prompt and locally. And this problem occurs when I use other class’s Draw() function

You you type:

gPad->Update();

Does it pop up the canvas ?

I type

root [2] TCanvas*c=new TCanvas()
(TCanvas *) 0x26caea0
root [3] gPad->Update()

and nothing happened

try to start root with option -n:

root -n

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