}
+void
+AbstractPlotModule::appendLegend(const std::string &setname)
+{
+ impl_->legend_.push_back(setname);
+}
+
+
void
AbstractPlotModule::setXFormat(int width, int precision, char format)
{
* together.
*/
void appendLegend(const char *setname);
+ //! \copydoc appendLegend(const char *)
+ void appendLegend(const std::string &setname);
/*! \brief
* Set field width and precision for X value output.
*/
plotm->setTitle("Average angle");
plotm->setXAxisIsTime();
plotm->setYLabel("Angle (degrees)");
- // TODO: Add legends
+ // TODO: Consider adding information about the second selection,
+ // and/or a subtitle describing what kind of angle this is.
+ for (size_t g = 0; g < sel1_.size(); ++g)
+ {
+ plotm->appendLegend(sel1_[g].name());
+ }
averageModule_->addModule(plotm);
}
plotm->setTitle("Angle histogram");
plotm->setXLabel("Angle (degrees)");
plotm->setYLabel("Probability");
- // TODO: Add legends
+ // TODO: Consider adding information about the second selection,
+ // and/or a subtitle describing what kind of angle this is.
+ for (size_t g = 0; g < sel1_.size(); ++g)
+ {
+ plotm->appendLegend(sel1_[g].name());
+ }
histogramModule_->averager().addModule(plotm);
}
}
plotm->setTitle("Average distance");
plotm->setXAxisIsTime();
plotm->setYLabel("Distance (nm)");
- // TODO: Add legends
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plotm->appendLegend(sel_[g].name());
+ }
averageModule_->addModule(plotm);
}
plotm->setTitle("Distance histogram");
plotm->setXLabel("Distance (nm)");
plotm->setYLabel("Probability");
- // TODO: Add legends
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plotm->appendLegend(sel_[g].name());
+ }
histogramModule_->averager().addModule(plotm);
}
plotm->setTitle("Statistics for individual distances");
plotm->setXLabel("Distance index");
plotm->setYLabel("Average/standard deviation (nm)");
- // TODO: Add legends
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plotm->appendLegend(std::string(sel_[g].name()) + " avg");
+ plotm->appendLegend(std::string(sel_[g].name()) + " std.dev.");
+ }
// TODO: Consider whether this output format is the best possible.
allStatsModule_->addModule(plotm);
}
plot->setTitle("Selection size");
plot->setXAxisIsTime();
plot->setYLabel("Number");
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plot->appendLegend(sel_[g].name());
+ }
sdata_.addModule(plot);
}
plot->setXAxisIsTime();
plot->setYLabel("Fraction");
plot->setYFormat(6, 4);
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plot->appendLegend(sel_[g].name());
+ }
cdata_.addModule(plot);
}
plot->setXAxisIsTime();
plot->setYLabel("Occupancy");
plot->setYFormat(1, 0);
+ // TODO: Add legend? (there can be massive amount of columns)
mdata_.addModule(plot);
}
if (!fnOccupancy_.empty())
plot->setTitle("Fraction of time selection matches");
plot->setXLabel("Selected position");
plot->setYLabel("Occupied fraction");
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plot->appendLegend(sel_[g].name());
+ }
occupancyModule_->addModule(plot);
}
if (!fnLifetime_.empty())
plot->setTitle("Lifetime histogram");
plot->setXAxisIsTime();
plot->setYLabel("Number of occurrences");
+ for (size_t g = 0; g < sel_.size(); ++g)
+ {
+ plot->appendLegend(sel_[g].name());
+ }
lifetimeModule_->addModule(plot);
}