Re: Superimposing without drawing

From: Gero Flucke <>
Date: Tue, 5 Sep 2006 13:21:37 +0200 (CEST)

On Tue, 5 Sep 2006, Adam Roe wrote:

> Hi Rooters,
> I am trying to output a large number of TH2F's, and I am having the following issue. I am trying to take a data set in a graph, impose two lines on it, and then output the graph as a .gif file. The only way I have found to do this is by drawing the graph, drawing the lines on top, and then printing. This takes a very long time for so many graphs, and it is not needed for this program. The following is a test version of what i'm doing:
> {
> TCanvas *c1 = new TCanvas("testgraph","testgraph");
> TH1F *graph1 = new TH1F("graph1", "graph1", 10, -5, 5);
> graph1->FillRandom("gaus", 100);
> TLine *line1 = new TLine(-3,0,-3,30);
> TLine *line2 = new TLine(3,0,3,30);
> line1->SetLineColor(6);
> line2->SetLineColor(6);
> c1->cd();
> graph1->Draw();
> line1->Draw("SAME");
> line2->Draw("SAME");
> c1->Print("graph1.gif");
> }
> What I would like to do is somehow skip the Draw() portion and simply print the canvas, with no output to the screen.

Dear Adam,
a simple gROOT->SetBatch() in the beginning might help - at least it does for .ps and .eps.


        Gero Received on Tue Sep 05 2006 - 13:21:45 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET