本文整理汇总了C++中TVirtualPad::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ TVirtualPad::GetName方法的具体用法?C++ TVirtualPad::GetName怎么用?C++ TVirtualPad::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVirtualPad
的用法示例。
在下文中一共展示了TVirtualPad::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splithist
void splithist(double ratio=0.2){
TVirtualPad* pmain = TVirtualPad::Pad();
double h = 1. - pmain->GetTopMargin() - pmain->GetBottomMargin();
double xlow = 0.; //gStyle->GetPadLeftMargin();
double xhigh = 1.; // - gStyle->GetPadRightMargin();
double ytop = 1.; //- gStyle->GetPadTopMargin();
double ybot = 0.; //gStyle->GetPadBottomMargin();
double ymid = pmain->GetBottomMargin() + ratio * h; //ybot + ratio * (ytop-ybot);
double yp1bot = ymid;
double yp2top = ymid;
TPad* p1 = new TPad(TString(pmain->GetName()) + "_1", pmain->GetTitle(),
xlow, yp1bot, xhigh, ytop);
p1->SetNumber(1);
TPad* p2 = new TPad(TString(pmain->GetName()) + "_2", pmain->GetTitle(),
xlow, ybot, xhigh, yp2top);
p2->SetNumber(2);
p1->SetFillStyle(4000);
p2->SetFillStyle(4000);
double p1h = ytop - yp1bot;
double p2h = yp2top - ybot;
/*
p1->SetTopMargin(pmain->GetTopMargin()/p1h);
p1->SetBottomMargin((ymid-yp1bot)/p1h);
p1->SetLeftMargin(pmain->GetLeftMargin());
p1->SetRightMargin(pmain->GetRightMargin());
p2->SetTopMargin((ymid-yp2top)/p2h);
p2->SetBottomMargin(pmain->GetBottomMargin()/p2h);
p2->SetLeftMargin(pmain->GetLeftMargin());
p2->SetRightMargin(pmain->GetRightMargin());
*/
p1->SetTopMargin(0.11);
p1->SetBottomMargin(0.);
p1->SetRightMargin(0.02);
p2->SetTopMargin(0.);
p2->SetBottomMargin(0.3);
p2->SetRightMargin(0.02);
p2->Draw();
p1->Draw();
pmain->Modified();
p1->cd();
}
示例2: AddGrid
//_______________________________________________________________________________________
static void AddGrid()
{
TVirtualPad *thisPad = qPad();
if (thisPad) {
TView *view = thisPad->GetView();
if (!view) return;
Double_t min[3],max[3];
view->GetRange(min,max);
TList *list = thisPad->GetListOfPrimitives();
TString histName = thisPad->GetName();
TH2F *m_DummyHist = 0;
const Char_t *dummyName = "Axis3D";
histName += dummyName;
m_DummyHist = list->FindObject(histName.Data());
if (!m_DummyHist) {
m_DummyHist = new TH2F(histName.Data(),"",1,min[0],max[0],1,min[1],max[1]);
m_DummyHist->SetDirectory(0);
m_DummyHist->Draw("surf,same");
}
m_DummyHist->GetXaxis()->SetLimits(min[0],max[0]);
m_DummyHist->GetYaxis()->SetLimits(min[1],max[1]);
m_DummyHist->GetZaxis()->SetLimits(min[2],max[2]);
thisPad->Modified();
thisPad->Update();
}
}