本文整理汇总了C++中TGraphErrors::SetDrawOption方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraphErrors::SetDrawOption方法的具体用法?C++ TGraphErrors::SetDrawOption怎么用?C++ TGraphErrors::SetDrawOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraphErrors
的用法示例。
在下文中一共展示了TGraphErrors::SetDrawOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawMap
void ExpManager::DrawMap(TString NameTitle, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) {
TMultiGraph *mg = new TMultiGraph();
//Draw a cross
TGraphErrors *frame = new TGraphErrors(); //= new TGraph2DErrors(np, x_array, y_array, bz_array, ex, ey, ez);
frame->SetPoint(0,+0,+100);
frame->SetPoint(1,+0,-100);
frame->SetPoint(2,0,0);
frame->SetPoint(3,-100,0);
frame->SetPoint(4,+100,0);
frame->SetPoint(5,+0,+0);
frame->SetPoint(6,+0,-100);
frame->SetMarkerColor(kWhite);
frame->SetDrawOption("ap");
//Draw the map
TGraphErrors *fGraph = new TGraphErrors(); //= new TGraph2DErrors(np, x_array, y_array, bz_array, ex, ey, ez);
fGraph->SetMarkerSize(1.2);
fGraph->SetMarkerStyle(20);
fGraph->SetMarkerColor(kBlue);
fGraph->SetLineColor(kBlue);
fGraph->SetLineWidth(1);
//fGraph->SetDrawOption("ap");
int graph_counter = 0 ;
for (unsigned i=0; i< fExpY.size(); i++) {
if( (fExpX.at(i) >= xmin && fExpX.at(i) <= xmax) && (fExpY.at(i) >= ymin && fExpY.at(i) <= ymax) && (fExpZ.at(i) >= zmin && fExpZ.at(i) <= zmax) ) {
fGraph->SetPoint(graph_counter,fExpX.at(i),fExpY.at(i));
fGraph->SetPointError(graph_counter,fExpXErr.at(i),fExpYErr.at(i));
graph_counter++;
}
}
//fGraph->Write();
mg->SetTitle(NameTitle+Form(" Map : %.2f < X < %.2f mm %.2f < Y < %.2f mm %.2f < Z < %.2f mm;X (mm);Y (mm)",xmin,xmax,ymin,ymax,zmin,zmax));
mg->SetName(NameTitle+Form("_Map__X_%.2f_%.2fmm__Y_%.2f_%.2fmm__Z_%.2f_%.2fmm",xmin,xmax,ymin,ymax,zmin,zmax));
mg->Add(frame);
mg->Add(fGraph);
mg->Write();
}