Resizing a TGraph

From: Flanders, Joel M. \(JSC-SF2\)[LM] <joel.m.flanders_at_nasa.gov>
Date: Thu, 18 May 2006 10:50:28 -0500


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 Received on Thu May 18 2006 - 17:50:50 MEST

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