本文整理汇总了C++中TCanvas::GetLogy方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::GetLogy方法的具体用法?C++ TCanvas::GetLogy怎么用?C++ TCanvas::GetLogy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCanvas
的用法示例。
在下文中一共展示了TCanvas::GetLogy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawBeamSpotPdfs
void drawBeamSpotPdfs (TDirectory* directory, const char* coord,
const char* fname)
{
TH3* obsHisto = directory->Get("PVobs");
TH3* estHisto = directory->Get("PVest");
if ( obsHisto==0 || estHisto==0 ) return;
std::string fullName("PV");
fullName += coord;
if ( fname ) fullName += fname;
else fullName += directory->GetName();
TCanvas* c = new TCanvas(fullName.c_str(),fullName.c_str());
c->SetLogy(true);
TH1* obsHisto1D = obsHisto->Project3D(coord);
TH1* estHisto1D = estHisto->Project3D(coord);
TAxis* xaxis = obsHisto1D->GetXaxis();
string atitle("Primary vertex ");
atitle += coord;
atitle += " [cm]";
xaxis->SetTitle(atitle.c_str());
if ( c->GetLogy() ) obsHisto1D->SetMinimum(0.5);
obsHisto1D->SetMarkerStyle(21);
// obsHisto1D->SetLineColor(2);
// obsHisto1D->SetMarkerColor(2);
obsHisto1D->Draw("E0");
estHisto1D->SetLineColor(2);
estHisto1D->SetLineWidth(2);
estHisto1D->Draw("hist same c");
if ( strcmp(coord,"x") || strcmp(coord,"y") ) xaxis->SetNdivisions(508);
string epsName = fullName + ".eps";
c->SaveAs(epsName.c_str());
string pngName = fullName + ".png";
c->SaveAs(pngName.c_str());
}