19 #include <TGraphAsymmErrors.h>
21 #include <TMultiGraph.h>
28 namespace experimental {
32 const std::string& xaxis_title,
33 const std::string& yaxis_title,
bool legend, TStyle* style,
34 int width,
int height)
35 : ts_(ts), s_(style) {
40 mg_ =
new TMultiGraph();
41 c_->SetCanvasSize(width, height);
43 mg_->SetTitle(
Concat(title,
";", xaxis_title,
";", yaxis_title).c_str());
60 const std::string& legend_label,
61 const char* add_mg_options,
short line_color,
62 float line_color_alpha,
short line_style,
63 short line_width,
short marker_color,
64 float marker_color_alpha,
short marker_style,
65 float marker_size,
short fill_color,
66 float fill_color_alpha,
short fill_style) {
73 "The time series stored in this line graph does not contain "
75 ts_name,
"). Operation aborted.");
84 gr =
new TGraph(xvals.size(), xvals.data(), yvals.data());
86 gr =
new TGraphAsymmErrors(xvals.size(), xvals.data(), yvals.data(),
87 nullptr,
nullptr, el.data(), eh.data());
89 gr->SetTitle(legend_label.c_str());
90 gr->InvertBit(TGraph::EStatusBits::kNotEditable);
91 gr->SetLineColorAlpha(line_color, line_color_alpha);
92 gr->SetLineStyle(line_style);
93 gr->SetLineWidth(line_width);
94 gr->SetMarkerColorAlpha(marker_color, marker_color_alpha);
95 gr->SetMarkerStyle(marker_style);
96 gr->SetMarkerSize(marker_size);
97 gr->SetFillColorAlpha(fill_color, fill_color_alpha);
98 gr->SetFillStyle(fill_style);
100 mg_->Add(gr, add_mg_options);
101 if (
l_ && legend_label !=
"") {
102 l_->AddEntry(gr, legend_label.c_str());
111 c_->Draw(canvas_draw_option);
124 "LineGraph::SetLegendPos",
125 "This LineGraph was created without legend. Operation aborted.");
139 "LineGraph::SetLegendPosNDC",
140 "This LineGraph was created without legend. Operation aborted.");
146 const std::vector<std::string>& extensions) {
148 for (
auto& ext : extensions) {
149 auto full_path =
Concat(filenpath_wo_extension, ext);
150 Log::Info(
"LineGraph::SaveAs",
"Saved LineGraph at: ", full_path);
151 c_->SaveAs(full_path.c_str());
171 const std::string& ts_name)
const {
174 static std::vector<TGraph*> kEmpty;