Data::Plot class reference
[Core module]
Declaration
#include <Goptical/Data/Plot>
namespace Goptical {
namespace Data {
class Plot;
};
};
This class is a member of the Data namespace.
Inheritance
Description
This class is used to describe a data plot. It contains a list of PlotData objects and describes some plot properties (title, range, ...).
Plots can be built from data sets or obtained directly from various analysis functions. They can be rendered on a Io::RendererViewport object with the draw function.
Members
See also the full member list section for this class.
Functions
- Plot()
- PlotData & add_plot_data(const Set &data, const Io::Rgb &color = [...], const std::string &label = [...], PlotStyleMask style = [...])
- void add_plot_data(PlotData &data)
- void draw(Io::RendererViewport &r)
- void erase_plot_data()
- void fit_axes_range()
- Io::RendererAxes & get_axes()
- const Io::RendererAxes & get_axes() const
- unsigned int get_dimensions() const
- unsigned int get_plot_count() const
- PlotData & get_plot_data(unsigned int index)
- const PlotData & get_plot_data(unsigned int index) const
- const std::string & get_title() const
- Math::range_t get_x_data_range(unsigned int dimension = [...]) const
- bool get_xy_swap() const
- Math::range_t get_y_data_range() const
- void set_color(const Io::Rgb &color)
- void set_different_colors()
- void set_style(PlotStyleMask style)
- void set_title(const std::string &title)
- void set_xy_swap(bool doswap)
Members detail
Create a new empty plot
PlotData & add_plot_data(const Set &data, const Io::Rgb &color = Io::rgb_red, const std::string &label = "data", PlotStyleMask style = InterpolatePlot|PointPlot)
Create and add plot data from specified data set.
void add_plot_data(PlotData &data)
Add plot data
void draw(Io::RendererViewport &r)
draw
Discard all plot data set
Set axis position to dataset range
Io::RendererAxes & get_axes()
Get plot axes object
const Io::RendererAxes & get_axes() const
Get plot axes object
Get data sets dimensions, return 0 if inconsistent
Get plot data set count
PlotData & get_plot_data(unsigned int index)
Get plot data set at given index
const PlotData & get_plot_data(unsigned int index) const
Get plot data set at given index
const std::string & get_title() const
Get plot main title
Math::range_t get_x_data_range(unsigned int dimension = 0) const
Get range of x data in sets
Get x and y axis swap state for 2d plots
Math::range_t get_y_data_range() const
Get range of y data in sets
void set_color(const Io::Rgb &color)
Set color for all plots
Automatically choose different colors for each plot
void set_style(PlotStyleMask style)
Set plot style for all plot
void set_title(const std::string &title)
Set plot main title
Swap x and y axis for 2d plots