Changeset 14723 for trunk/FACT++/src
- Timestamp:
- 12/04/12 13:49:55 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/makeplots.cc
r14722 r14723 53 53 } 54 54 55 void DrawClone(TCanvas &c, TGraph &g) 56 { 57 if (g.GetN()==0) 58 return; 59 60 c.cd(); 61 ((TGraph*)g.DrawClone("C"))->SetBit(kCanDelete); 62 } 55 63 56 64 // ======================================================================== … … 184 192 185 193 TCanvas c1; 186 gPad->SetLeftMargin(0.085); 187 gPad->SetRightMargin(0.01); 188 gPad->SetTopMargin(0.03); 189 gPad->SetGrid(); 194 c1.SetFillColor(kWhite); 195 c1.SetBorderMode(0); 196 c1.SetFrameBorderMode(0); 197 c1.SetLeftMargin(0.085); 198 c1.SetRightMargin(0.01); 199 c1.SetTopMargin(0.03); 200 c1.SetGrid(); 190 201 hframe.GetYaxis()->SetTitle("Altitude [deg]"); 191 202 hframe.SetMinimum(15); … … 194 205 195 206 TCanvas c2; 196 gPad->SetLeftMargin(0.085); 197 gPad->SetRightMargin(0.01); 198 gPad->SetTopMargin(0.03); 199 gPad->SetGrid(); 207 c2.SetFillColor(kWhite); 208 c2.SetBorderMode(0); 209 c2.SetFrameBorderMode(0); 210 c2.SetLeftMargin(0.085); 211 c2.SetRightMargin(0.01); 212 c2.SetTopMargin(0.03); 213 c2.SetGrid(); 200 214 hframe.GetYaxis()->SetTitle("Predicted Current [\\muA]"); 201 215 hframe.SetMinimum(0); … … 204 218 205 219 TCanvas c3; 206 gPad->SetLeftMargin(0.085); 207 gPad->SetRightMargin(0.01); 208 gPad->SetTopMargin(0.03); 209 gPad->SetGrid(); 210 gPad->SetLogy(); 220 c3.SetFillColor(kWhite); 221 c3.SetBorderMode(0); 222 c3.SetFrameBorderMode(0); 223 c3.SetLeftMargin(0.085); 224 c3.SetRightMargin(0.01); 225 c3.SetTopMargin(0.03); 226 c3.SetGrid(); 227 c3.SetLogy(); 211 228 hframe.GetYaxis()->SetTitle("Estimated relative threshold"); 212 229 hframe.SetMinimum(0.9); … … 215 232 216 233 TCanvas c4; 217 gPad->SetLeftMargin(0.085); 218 gPad->SetRightMargin(0.01); 219 gPad->SetTopMargin(0.03); 220 gPad->SetGrid(); 234 c4.SetFillColor(kWhite); 235 c4.SetBorderMode(0); 236 c4.SetFrameBorderMode(0); 237 c4.SetLeftMargin(0.085); 238 c4.SetRightMargin(0.01); 239 c4.SetTopMargin(0.03); 240 c4.SetGrid(); 221 241 hframe.GetYaxis()->SetTitle("Distance to moon [deg]"); 222 242 hframe.SetMinimum(0); … … 262 282 gm.SetLineColor(kYellow); 263 283 284 if (cnt==0) 285 leg.AddEntry(gm.Clone(), "Moon", "l"); 286 leg.AddEntry(g1.Clone(), name.data(), "l"); 287 264 288 // Loop over 24 hours 265 289 int i=0; … … 319 343 } 320 344 321 // Add graphs to canvases and add corresponding entry to legend322 c1.cd();323 345 if (cnt==0) 324 { 325 TGraph *g = (TGraph*)gm.DrawClone("C"); 326 g->SetBit(kCanDelete); 327 leg.AddEntry(g, "Moon", "l"); 328 } 329 ((TGraph*)g1.DrawClone("C"))->SetBit(kCanDelete); 330 331 c2.cd(); 332 ((TGraph*)g2.DrawClone("C"))->SetBit(kCanDelete); 333 334 c3.cd(); 335 ((TGraph*)g3.DrawClone("C"))->SetBit(kCanDelete); 336 337 c4.cd(); 338 TGraph *g = (TGraph*)g4.DrawClone("C"); 339 g->SetBit(kCanDelete); 340 341 leg.AddEntry(g, name.data(), "l"); 346 DrawClone(c1, gm); 347 348 DrawClone(c1, g1); 349 DrawClone(c2, g2); 350 DrawClone(c3, g3); 351 DrawClone(c4, g4); 342 352 } 343 353 … … 345 355 // Save three plots 346 356 TCanvas c5; 357 c5.SetFillColor(kWhite); 358 c5.SetBorderMode(0); 359 c5.SetFrameBorderMode(0); 347 360 leg.Draw(); 348 361 349 c1.SaveAs("test1.eps"); 350 c2.SaveAs("test2.eps"); 351 c3.SaveAs("test3.eps"); 352 c4.SaveAs("test4.eps"); 353 c5.SaveAs("legend.eps"); 354 355 c1.SaveAs("test1.root"); 356 c2.SaveAs("test2.root"); 357 c3.SaveAs("test3.root"); 358 c4.SaveAs("test4.root"); 362 const string t = Time(jd).GetAsStr("%Y%m%d"); 363 364 c1.SaveAs((t+"-ZenithDistance.eps").c_str()); 365 c2.SaveAs((t+"-PredictedCurrent.eps").c_str()); 366 c3.SaveAs((t+"-RelativeThreshold.eps").c_str()); 367 c4.SaveAs((t+"-MoonDist.eps").c_str()); 368 c5.SaveAs((t+"-Legend.eps").c_str()); 369 370 c1.SaveAs((t+"-ZenithDistance.root").c_str()); 371 c2.SaveAs((t+"-PredictedCurrent.root").c_str()); 372 c3.SaveAs((t+"-RelativeThreshold.root").c_str()); 373 c4.SaveAs((t+"-MoonDist.root").c_str()); 359 374 360 375 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.