Plotting to mother canvas instead of sub-pad

Can someone explain to me why the following code fails to draw the histogram on the first sub pad (appears to be on the mother canvas) and, naturally, how to get ROOT to draw it on the first sub pad. I feel like I’m missing something really basic here.

  TH1F* hFrame = new TH1F("hFrame","Ellipse",100, -2, 2);

  TCanvas* c2 = new TCanvas("c2","c2", 900, 400);


ROOT Version: 6.18/04
Platform: MacOS 10.14.6

Try with: hFrame->DrawCopy();

If it doesn’t help, try to play with (there is a long standing problem with ROOT + Cocoa):

Why don’t you simply use hFrame->Draw(); ? It works fine.

DrawCopy works fine. Thanks.

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