2016-05-06 16 views
0

是否有任何命令從命令行/終端生成多個圖形?我有一個.root文件,其中包含處理圖形對象,所以我能夠一次畫一個圖用命令在ROOT中繪製多個TGraphs

pAngRateAlld_S0_M0->Draw("Hist"); 

文件被打開時root -l maplot_20070101_4m.root

回答

1

你打開你的文件,後:

root -l filename.root 

可以得出一個TGraph有:

myGraph->Draw("apl"); 

或與其他選項類似:

myGraph->Draw("Hist"); 

重要的是要認識到這會創建一個默認畫布。如果您嘗試繪製另一個圖形,它將在同一個畫布中繪製它,即它將替換最後一個。

有多個圖形有幾個選項:

每帆布

1)一個圖:你需要繪製它之前創建的每個圖形畫布:

TCanvas *c1=new TCanvas(); 
myGraph1->Draw("apl"); 
TCanvas *c2=new TCanvas(); 
myGraph2->Draw("apl"); 
etc. 

2)在多個圖形同樣的情節:

myGraph1->Draw("apl"); 
myGraph2->Draw("pl same"); 
myGraph3->Draw("pl same"); 

3)分裂畫布:

TCanvas *c1=new TCanvas(); 
c1->Divide(3,3); // divides the canvas into three rows and three columns 
c1->cd(1); 
myGraph1->Draw("apl"); 
c1->cd(2); 
myGraph2->Draw("apl");