Note: This file assumes a certain structure on the input file.
The structure is as follows:
Keeping this in mind makes the main loop in getRocCurves easier to follow :) Private class that simplify drawing plots combining information from several methods.
Each wrapper will manage a canvas and a legend and provide convenience functions to add data to these. It also provides a save function for saving an image representation to disk.
Feel free to extend this class as you see fit. It is intended as a convenience when showing multiclass roccurves, not a fully general tool.
Usage: auto p = new EfficiencyPlotWrapper(name, title, dataset, i): for (TGraph * g : listOfGraphs) { p->AddGraph(g); p->AddLegendEntry(methodName); } p->save();
Definition at line 88 of file efficienciesMulticlass.cxx.
Public Member Functions | |
EfficiencyPlotWrapper (TString name, TString title, TString dataset, size_t i) | |
Private class EfficiencyPlotWrapper - Implementation. | |
Int_t | addGraph (TGraph *graph) |
Adds a new graph to the plot. | |
void | addLegendEntry (TString methodTitle, TGraph *graph) |
WARNING: Uses the current color, thus the correct call ordering is: plotWrapper->addGraph(...); plotWrapper->addLegendEntry(...);. | |
void | save () |
Saves the current state of the plot to disk. | |
Public Attributes | |
TCanvas * | fCanvas |
Int_t | fColor |
TString | fDataset |
TLegend * | fLegend |
UInt_t | fNumMethods |
Private Member Functions | |
TCanvas * | newEfficiencyCanvas (TString name, TString title, size_t i) |
Helper to create new Canvas. | |
TLegend * | newEfficiencyLegend () |
Helper to create new legend. | |
Private Attributes | |
Float_t | fdxL |
Float_t | fdyH |
Float_t | fx0L |
Float_t | fy0H |
EfficiencyPlotWrapper::EfficiencyPlotWrapper | ( | TString | name, |
TString | title, | ||
TString | dataset, | ||
size_t | i | ||
) |
Private class EfficiencyPlotWrapper - Implementation.
Constructs a new canvas + auxiliary data for showing an efficiency plot.
Definition at line 395 of file efficienciesMulticlass.cxx.
Adds a new graph to the plot.
The added graph should contain a single ROC curve.
Definition at line 419 of file efficienciesMulticlass.cxx.
WARNING: Uses the current color, thus the correct call ordering is: plotWrapper->addGraph(...); plotWrapper->addLegendEntry(...);.
Definition at line 443 of file efficienciesMulticlass.cxx.
|
private |
Helper to create new Canvas.
name | Name... |
title | Title to be displayed on canvas |
i | Index to offset a collection of canvases from each other |
Definition at line 462 of file efficienciesMulticlass.cxx.
|
private |
Helper to create new legend.
Definition at line 492 of file efficienciesMulticlass.cxx.
void EfficiencyPlotWrapper::save | ( | ) |
Saves the current state of the plot to disk.
Definition at line 507 of file efficienciesMulticlass.cxx.
TCanvas* EfficiencyPlotWrapper::fCanvas |
Definition at line 90 of file efficienciesMulticlass.cxx.
Int_t EfficiencyPlotWrapper::fColor |
Definition at line 95 of file efficienciesMulticlass.cxx.
TString EfficiencyPlotWrapper::fDataset |
Definition at line 93 of file efficienciesMulticlass.cxx.
|
private |
Definition at line 108 of file efficienciesMulticlass.cxx.
|
private |
Definition at line 110 of file efficienciesMulticlass.cxx.
TLegend* EfficiencyPlotWrapper::fLegend |
Definition at line 91 of file efficienciesMulticlass.cxx.
UInt_t EfficiencyPlotWrapper::fNumMethods |
Definition at line 97 of file efficienciesMulticlass.cxx.
|
private |
Definition at line 107 of file efficienciesMulticlass.cxx.
|
private |
Definition at line 109 of file efficienciesMulticlass.cxx.