Re: Resizing a TGraph

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Thu, 18 May 2006 18:51:13 +0200 (CEST)

   c1->SetBottomMargin(0.17);

On Thu, 18 May 2006, Flanders, Joel M. (JSC-SF2)[LM] wrote:

> I am using ROOT version 5.11 on a Windows XP machine. I have run the
> following macro:
>
> TGraph *gr1 = new TGraph();
> gr1->SetPoint(0,0,2500);
> gr1->SetPoint(1,60,3000);
> c1 = new TCanvas("c1","Test",10,10,1152,864);
> c1->SetFillColor(0);
> c1->SetGrid();
> p1 = new TPaveLabel(0.35,0.98,0.6,0.93,"Test");
> p1->Draw();
> gr1->SetLineWidth(2);
> gr1->SetTitle("");
> gr1->SetFillStyle(0);
> gr1->SetFillColor(0);
> gr1->SetLineColor(1);
>
> gr1->GetXaxis()->SetTitle("X-Axis");
>
> gr1->GetYaxis()->SetTitle("Y-Axis");
> gr1->GetYaxis()->UnZoom();
> gr1->GetYaxis()->SetTitleOffset(1.3);
> gr1->GetXaxis()->SetTimeDisplay(1);
>
> gr1->GetXaxis()->SetTimeFormat("#splitline{%m\/%d\/%y}{%H\:%M\:%S}");
> gr1->GetXaxis()->SetLabelOffset(0.03);
> gr1->GetXaxis()->SetNdivisions(508);
> gr1->GetXaxis()->SetTitleOffset(1.7);
>
> gr1->Draw("ALP");
>
> c1->Update();
> c1->GetFrame()->SetFillColor(0);
> c1->GetFrame()->SetBorderMode(0);
> c1->Modified();
>
> This macro creates a graph with a time axis. The problem is that the
> Axis Title can not be seen, so I need to resize the graph. I want to
> resize this graph from the command line. Is it possible to do this?
>
> Thanks,
> Joel
>

-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet_at_cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7670300
Received on Thu May 18 2006 - 18:51:20 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET