本文整理汇总了C++中TCanvas::GetUxmin方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::GetUxmin方法的具体用法?C++ TCanvas::GetUxmin怎么用?C++ TCanvas::GetUxmin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCanvas
的用法示例。
在下文中一共展示了TCanvas::GetUxmin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: good_bad
void plotter::good_bad(vector<double> &vecx, vector<double> &best_gen, vector<double> &smeared_gen, string filename, string title, string xaxis_label)
{
cout << "scattering plot" << endl;
int n = vecx.size();
double arrx[n];
double arry[n];
for (int i=0; i<n; i++){
//arrx[i] = log10(vecx.at(i)+1e-20);
arrx[i] = vecx.at(i);
double dif = abs(best_gen.at(i)) - abs(smeared_gen.at(i));
arry[i] = dif;
}
cout << "created arrs" << endl;
TCanvas* canvas = new TCanvas("canvas");
TGraph *g = new TGraph(n, arrx, arry);
g->SetMarkerStyle(2);
cout << "getting axes" << endl;
g->Draw("ap");
g->GetXaxis()->SetTitle(xaxis_label.c_str());
g->GetYaxis()->SetTitle("abs(best_gen) - abs(smeared_gen)");
//g->GetXaxis()->SetRangeUser(0,1);
//g->GetYaxis()->SetRangeUser(0,20000);
g->SetTitle((title).c_str());
canvas->Update();
TLine *l = new TLine(canvas->GetUxmin(), 0.0, canvas->GetUxmax(), 0.0);
l->SetLineColor(kBlue);
l->Draw();
cout << "before draw" << endl;
//g->Draw("ap");
canvas->Update();
cout << "after draw" << endl;
canvas->Print(filename.c_str());
cout << "after print" << endl;
}