RE: Print divided canvas

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 29 Oct 2007 11:55:11 +0100


Hi,

After the last Draw() do:

gPad->Print("a.ps");

The 2nd pad only will be saved in the file a.ps.

Cheers, OC.

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Manuel Mussini
Sent: Monday, October 29, 2007 11:48 AM
To: roottalk_at_lxbuild091.cern.ch
Subject: [ROOT] Print divided canvas

Hi,
In my code something like this happens:

TCanvas *canvas;
TH1F *h;
h = new TH1F("hist", "Histo", 10, 0., 10.); canvas = new TCanvas("canv", "Canvas", 0, 0, 800, 400); canvas->Divide(2, 1);
canvas->cd(1);
h->Draw();
canvas->cd(2);
h->Draw();
// ???

Instead of "// ???" I'd like to write something to save the subpads separately!
I tried several ways with "SaveAs" or "Print" but I didn't get what I want!
Which is the best way to do this?

Thanks!

Bye... Received on Mon Oct 29 2007 - 11:55:27 CET

This archive was generated by hypermail 2.2.0 : Wed Oct 31 2007 - 17:50:02 CET