24#include <scatter/Figure.hpp>
25#include <scatter/PlotOptions.hpp>
46 class Plot :
public std::enable_shared_from_this<Plot>
85 template <
class T,
class... Args>
86 typename T::Options *
add(Args &&...args)
88 plots_.push_back(std::make_unique<T>(args...));
90 return dynamic_cast<T *
>(plots_.back().get())->
options();
114 void render(
Renderer &renderer,
const Point &origin,
const double &width,
const double &height);
118 std::vector<std::unique_ptr<PlotBase>> plots_;
121 std::unique_ptr<Axis> axis_;
124 std::unique_ptr<Legend> legend_;
131 typedef std::shared_ptr<Plot>
Ptr;
[brief description]
Definition PlotOptions.hpp:36
main class for creating plots
Definition Plot.hpp:47
Plot()=delete
delete default constructor in order to enforce using Plot::create
static Plot::Ptr create(const std::string &title, const PlotOptions &options=PlotOptions())
create a new Plot
bool save(const std::string &file, const FigureOptions &options=FigureOptions())
save the plot to the given filepath
std::shared_ptr< Plot > Ptr
typedef for convenience
Definition Plot.hpp:131
static Plot::Ptr create(const PlotOptions &options=PlotOptions())
create a new Plot
virtual ~Plot()
destructor
PlotOptions & options()
[brief description]
T::Options * add(Args &&...args)
[brief description]
Definition Plot.hpp:86
[brief description]
Definition Point.hpp:29
[brief description]
Definition Renderer.hpp:38