Plot2D Class Reference
The class used to create a plot containing graphical elements. More...
#include <Plot2D.hpp>
Inheritance diagram for Plot2D:
Collaboration diagram for Plot2D:
Public Member Functions | |
Plot2D () | |
Construct a default Plot object. | |
template<typename X , typename... Vecs> | |
auto | drawWithVecs (const std::string &with, const X &, const Vecs &... vecs) -> DrawSpecs & |
Draw plot object with given style and given vectors (e.g., plot.draw("lines", x, y) ). | |
template<typename X , typename... Vecs> | |
auto | drawWithVecsContainingNaN (std::string with, const X &, const Vecs &... vecs) -> DrawSpecs & |
Draw plot object with given style and given vectors (e.g., plot.draw("lines", x, y) ) that may contain NaN values. | |
template<typename X , typename Y > | |
auto | drawCurve (const X &x, const Y &y) -> DrawSpecs & |
Draw a curve with given x and y vectors. | |
template<typename X , typename Y > | |
auto | drawCurveWithPoints (const X &x, const Y &y) -> DrawSpecs & |
Draw a curve with points with given x and y vectors. | |
template<typename X , typename Y , typename XD > | |
auto | drawCurveWithErrorBarsX (const X &x, const Y &y, const XD &xdelta) -> DrawSpecs & |
Draw a curve with error bars along x with given x , y , and xdelta vectors. | |
template<typename X , typename Y , typename XL , typename XH > | |
auto | drawCurveWithErrorBarsX (const X &x, const Y &y, const XL &xlow, const XH &xhigh) -> DrawSpecs & |
Draw a curve with error bars along x with given x , y , xlow , and xhigh vectors. | |
template<typename X , typename Y , typename YD > | |
auto | drawCurveWithErrorBarsY (const X &x, const Y &y, const YD &ydelta) -> DrawSpecs & |
Draw a curve with error bars along y with given x , y , and ydelta vectors. | |
template<typename X , typename Y , typename YL , typename YH > | |
auto | drawCurveWithErrorBarsY (const X &x, const Y &y, const YL &ylow, const YH &yhigh) -> DrawSpecs & |
Draw a curve with error bars along y with given x , y , ylow , and yhigh vectors. | |
template<typename X , typename Y , typename XD , typename YD > | |
auto | drawCurveWithErrorBarsXY (const X &x, const Y &y, const XD &xdelta, const YD &ydelta) -> DrawSpecs & |
Draw a curve with error bars along x and y with given x , y , xdelta , and ydelta vectors. | |
template<typename X , typename Y , typename XL , typename XH , typename YL , typename YH > | |
auto | drawCurveWithErrorBarsXY (const X &x, const Y &y, const XL &xlow, const XH &xhigh, const YL &ylow, const YH &yhigh) -> DrawSpecs & |
Draw a curve with error bars along x and y with given x , y , xlow , xhigh , ylow , and yhigh vectors. | |
template<typename X , typename Y > | |
auto | drawBrokenCurve (const X &x, const Y &y) -> DrawSpecs & |
Draw a curve with given x and y vectors, breaking this curve whenever NaN is found in x or y . | |
template<typename X , typename Y > | |
auto | drawBrokenCurveWithPoints (const X &x, const Y &y) -> DrawSpecs & |
Draw a curve with points with given x and y vectors, breaking this curve whenever NaN is found in x or y . | |
template<typename X , typename Y > | |
auto | drawCurveFilled (const X &x, const Y &y) -> DrawSpecs & |
Draw curves with given x and y vectors with filled areas above / below axes. | |
template<typename X , typename Y1 , typename Y2 > | |
auto | drawCurvesFilled (const X &x, const Y1 &y1, const Y2 &y2) -> DrawSpecs & |
Draw curves with given x , y1 and y2 vectors with filled areas above / below / between curves. | |
template<typename X , typename Y > | |
auto | drawBoxes (const X &x, const Y &y) -> DrawSpecs & |
Draw boxes with given x and y vectors. | |
template<typename X , typename Y , typename XW > | |
auto | drawBoxes (const X &x, const Y &y, const XW &xwidth) -> DrawSpecs & |
Draw boxes with given x and y vectors as well as the box widths xwidth . | |
template<typename X , typename Y , typename YD > | |
auto | drawBoxesWithErrorBarsY (const X &x, const Y &y, const Y &ydelta) -> DrawSpecs & |
Draw boxes with error bars along y with given x , y , ydelta vectors. | |
template<typename X , typename Y , typename YL , typename YH > | |
auto | drawBoxesWithErrorBarsY (const X &x, const Y &y, const YL &ylow, const YH &yhigh) -> DrawSpecs & |
Draw boxes with error bars along y with given x , y , ylow , and yhigh vectors. | |
template<typename X , typename Y , typename XD > | |
auto | drawErrorBarsX (const X &x, const Y &y, const XD &xdelta) -> DrawSpecs & |
Draw error bars along x with given x , y , and xdelta vectors. | |
template<typename X , typename Y , typename XL , typename XH > | |
auto | drawErrorBarsX (const X &x, const Y &y, const XL &xlow, const XH &xhigh) -> DrawSpecs & |
Draw error bars along x with given x , y , xlow , and xhigh vectors. | |
template<typename X , typename Y , typename YD > | |
auto | drawErrorBarsY (const X &x, const Y &y, const YD &ydelta) -> DrawSpecs & |
Draw error bars along y with given x , y , and ydelta vectors. | |
template<typename X , typename Y , typename YL , typename YH > | |
auto | drawErrorBarsY (const X &x, const Y &y, const YL &ylow, const YH &yhigh) -> DrawSpecs & |
Draw error bars along y with given x , y , ylow , and yhigh vectors. | |
template<typename X , typename Y , typename XD , typename YD > | |
auto | drawErrorBarsXY (const X &x, const Y &y, const XD &xdelta, const YD &ydelta) -> DrawSpecs & |
Draw error bars along x and y with given x , y , xdelta , and ydelta vectors. | |
template<typename X , typename Y , typename XL , typename XH , typename YL , typename YH > | |
auto | drawErrorBarsXY (const X &x, const Y &y, const XL &xlow, const XH &xhigh, const YL &ylow, const YH &yhigh) -> DrawSpecs & |
Draw error bars along x and y with given x , y , xlow , xhigh , ylow , and yhigh vectors. | |
template<typename X , typename Y > | |
auto | drawSteps (const X &x, const Y &y) -> DrawSpecs & |
Draw steps with given x and y vectors. Identical to drawStepsChangeFirstX. | |
template<typename X , typename Y > | |
auto | drawStepsChangeFirstX (const X &x, const Y &y) -> DrawSpecs & |
Draw steps with given x and y vectors with steps along x changes first. | |
template<typename X , typename Y > | |
auto | drawStepsChangeFirstY (const X &x, const Y &y) -> DrawSpecs & |
Draw steps with given x and y vectors with steps along y changes first. | |
template<typename X , typename Y > | |
auto | drawStepsHistogram (const X &x, const Y &y) -> DrawSpecs & |
Draw steps with given x and y vectors in a histogram style. | |
template<typename X , typename Y > | |
auto | drawStepsFilled (const X &x, const Y &y) -> DrawSpecs & |
Draw steps with given x and y vectors with filled area below steps. | |
template<typename X , typename Y > | |
auto | drawDots (const X &x, const Y &y) -> DrawSpecs & |
Draw dots with given x and y vectors. | |
template<typename X , typename Y > | |
auto | drawPoints (const X &x, const Y &y) -> DrawSpecs & |
Draw points with given x and y vectors. | |
template<typename X , typename Y > | |
auto | drawImpulses (const X &x, const Y &y) -> DrawSpecs & |
Draw impulses with given x and y vectors. | |
template<typename Y > | |
auto | drawHistogram (const Y &y) -> DrawSpecs & |
Draw a histogram for the given y vector. | |
auto | drawWithCols (const std::string &fname, const std::string &with, const std::vector< ColumnIndex > &cols) -> DrawSpecs & |
Draw plot object with given style and given vectors (e.g., plot.draw("lines", x, y) ). | |
auto | drawCurve (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw a curve with given values at xcol and ycol columns in file fname . | |
auto | drawCurveWithPoints (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw a curve with points with given values at xcol and ycol columns in file fname . | |
auto | drawCurveWithErrorBarsX (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xdeltacol) -> DrawSpecs & |
Draw a curve with error bars along x with given values at xcol , ycol , and xdeltacol columns in file fname . | |
auto | drawCurveWithErrorBarsX (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xlowcol, ColumnIndex xhighcol) -> DrawSpecs & |
Draw a curve with error bars along x with given values at xcol , ycol , xlowcol , and xhighcol columns in file fname . | |
auto | drawCurveWithErrorBarsY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex ydeltacol) -> DrawSpecs & |
Draw a curve with error bars along y with given values at xcol , ycol , and ydeltacol columns in file fname . | |
auto | drawCurveWithErrorBarsY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex ylowcol, ColumnIndex yhighcol) -> DrawSpecs & |
Draw a curve with error bars along y with given values at xcol , ycol , ylowcol , and yhighcol columns in file fname . | |
auto | drawCurveWithErrorBarsXY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xdeltacol, ColumnIndex ydeltacol) -> DrawSpecs & |
Draw a curve with error bars along x and y with given values at xcol , ycol , xdeltacol , and ydeltacol columns in file fname . | |
auto | drawCurveWithErrorBarsXY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xlowcol, ColumnIndex xhighcol, ColumnIndex ylowcol, ColumnIndex yhighcol) -> DrawSpecs & |
Draw a curve with error bars along x and y with given values at xcol , ycol , xlowcol , xhighcol , ylowcol , and yhighcol columns in file fname . | |
auto | drawBoxes (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw boxes with given values at xcol and ycol columns in file fname . | |
auto | drawBoxes (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xwidthcol) -> DrawSpecs & |
Draw boxes with given values at xcol and ycol columns in file fname as well as the box widths xwidthcol . | |
auto | drawBoxesWithErrorBarsY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex ydeltacol) -> DrawSpecs & |
Draw boxes with error bars along y with given values at xcol , ycol , ydeltacol columns in file fname . | |
auto | drawBoxesWithErrorBarsY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex ylowcol, ColumnIndex yhighcol) -> DrawSpecs & |
Draw boxes with error bars along y with given values at xcol , ycol , ylowcol , and yhighcol columns in file fname . | |
auto | drawErrorBarsX (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xdeltacol) -> DrawSpecs & |
Draw error bars along x with given values at xcol , ycol , and xdeltacol columns in file fname . | |
auto | drawErrorBarsX (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xlowcol, ColumnIndex xhighcol) -> DrawSpecs & |
Draw error bars along x with given values at xcol , ycol , xlowcol , and xhighcol columns in file fname . | |
auto | drawErrorBarsY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex ydeltacol) -> DrawSpecs & |
Draw error bars along y with given values at xcol , ycol , and ydeltacol columns in file fname . | |
auto | drawErrorBarsY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex ylowcol, ColumnIndex yhighcol) -> DrawSpecs & |
Draw error bars along y with given values at xcol , ycol , ylowcol , and yhighcol columns in file fname . | |
auto | drawErrorBarsXY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xdeltacol, ColumnIndex ydeltacol) -> DrawSpecs & |
Draw error bars along x and y with given values at xcol , ycol , xdeltacol , and ydeltacol columns in file fname . | |
auto | drawErrorBarsXY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol, ColumnIndex xlowcol, ColumnIndex xhighcol, ColumnIndex ylowcol, ColumnIndex yhighcol) -> DrawSpecs & |
Draw error bars along x and y with given values at xcol , ycol , xlowcol , xhighcol , ylowcol , and yhighcol columns in file fname . | |
auto | drawSteps (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw steps with given values at xcol and ycol columns in file fname . Identical to drawStepsChangeFirstX. | |
auto | drawStepsChangeFirstX (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw steps with given values at xcol and ycol columns in file fname with steps along x changes first. | |
auto | drawStepsChangeFirstY (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw steps with given values at xcol and ycol columns in file fname with steps along y changes first. | |
auto | drawStepsHistogram (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw steps with given values at xcol and ycol columns in file fname in a histogram style. | |
auto | drawStepsFilled (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw steps with given values at xcol and ycol columns in file fname with filled area below steps. | |
auto | drawDots (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw dots with given values at xcol and ycol columns in file fname . | |
auto | drawPoints (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw points with given values at xcol and ycol columns in file fname . | |
auto | drawImpulses (const std::string &fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs & |
Draw impulses with given values at xcol and ycol columns in file fname . | |
auto | drawHistogram (std::string fname, ColumnIndex ycol) -> DrawSpecs & |
Draw a histogram with given values at ycol column in file fname . | |
auto | repr () const -> std::string override |
Convert this plot object into a gnuplot formatted string. | |
Public Member Functions inherited from Plot | |
Plot () | |
Construct a default Plot object. | |
virtual | ~Plot ()=default |
Virtual destructor to avoid memory leaks. | |
auto | palette (const std::string &name) -> Plot & |
Set the palette of colors for the plot. More... | |
auto | size (std::size_t width, std::size_t height) -> Plot & |
Set the size of the plot (in unit of points, with 1 inch = 72 points). | |
auto | fontName (const std::string &name) -> Plot & |
Set the font name for the plot (e.g., Helvetica, Georgia, Times). | |
auto | fontSize (std::size_t size) -> Plot & |
Set the font size for the plot (e.g., 10, 12, 16). | |
auto | border () -> BorderSpecs & |
Set the border of the plot and return a reference to the corresponding specs object. | |
auto | grid () -> GridSpecs & |
Set the grid of the plot and return a reference to the corresponding specs object. | |
auto | xlabel (const std::string &label) -> AxisLabelSpecs & |
Set the label of the x-axis and return a reference to the corresponding specs object. | |
auto | ylabel (const std::string &label) -> AxisLabelSpecs & |
Set the label of the y-axis and return a reference to the corresponding specs object. | |
auto | xrange (const StringOrDouble &min, const StringOrDouble &max) -> Plot & |
Set the x-range of the plot (also possible with empty values or autoscale options (e.g. "", "*")). | |
auto | yrange (const StringOrDouble &min, const StringOrDouble &max) -> Plot & |
Set the y-range of the plot (also possible with empty values or autoscale options (e.g. "", "*")). | |
auto | boxWidthAbsolute (double val) -> Plot & |
Set the default width of boxes in plots containing boxes (in absolute mode). More... | |
auto | boxWidthRelative (double val) -> Plot & |
Set the default width of boxes in plots containing boxes (in relative mode). More... | |
auto | tics () -> TicsSpecs & |
Set the tics of the plot and return a reference to the corresponding specs object. | |
auto | xtics () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major xtics on the bottom axis. | |
auto | ytics () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major ytics on the left axis. | |
auto | ztics () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major ztics. | |
auto | rtics () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major rtics. | |
auto | xticsMajorBottom () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major xtics on the bottom axis. | |
auto | xticsMajorTop () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major xtics on the top axis. | |
auto | xticsMinorBottom () -> TicsSpecsMinor & |
Return the specifications of the grid lines along minor xtics on the bottom axis. | |
auto | xticsMinorTop () -> TicsSpecsMinor & |
Return the specifications of the grid lines along minor xtics on the top axis. | |
auto | yticsMajorLeft () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major ytics on the left axis. | |
auto | yticsMajorRight () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major ytics on the right axis. | |
auto | yticsMinorLeft () -> TicsSpecsMinor & |
Return the specifications of the grid lines along minor ytics on the left axis. | |
auto | yticsMinorRight () -> TicsSpecsMinor & |
Return the specifications of the grid lines along minor ytics on the right axis. | |
auto | zticsMajor () -> TicsSpecsMajor & |
Return the specifications of the grid lines along major ztics. | |
auto | zticsMinor () -> TicsSpecsMinor & |
Return the specifications of the grid lines along minor ztics. | |
auto | rticsMajor () -> TicsSpecsMajor & |
Return the specifications of the grid lines along minor rtics. | |
auto | rticsMinor () -> TicsSpecsMinor & |
Return the specifications of the grid lines along minor rtics. | |
auto | styleFill () -> FillStyleSpecs & |
Return an object that permits fill style to be customized. | |
auto | styleHistogram () -> HistogramStyleSpecs & |
Return an object that permits histogram style to be customized. | |
auto | draw (const std::string &what, const std::string &use, const std::string &with) -> DrawSpecs & |
Draw plot object with given what , using and with expressions (e.g., plot.draw("sin(x)*cos(x)", "", "linespoints") , (e.g., plot.draw("file.dat", "1:2", "points") )). | |
auto | legend () -> LegendSpecs & |
Set the legend of the plot and return a reference to the corresponding specs object. | |
auto | samples (std::size_t value) -> void |
Set the number of sample points for analytical plots. | |
auto | gnuplot (const std::string &command) -> void |
Use this method to provide gnuplot commands to be executed before the plotting calls. | |
auto | savePlotData () const -> void |
Write the current plot data to the data file. | |
auto | autoclean (bool enable=true) -> void |
Toggle automatic cleaning of temporary files (enabled by default). More... | |
auto | cleanup () const -> void |
Delete all files used to store plot data or scripts. | |
auto | clear () -> void |
Clear all draw and gnuplot commands. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Plot | |
std::size_t | m_id = 0 |
The Plot id derived from m_counter upon construction (must be the first member due to constructor initialization order!) | |
bool | m_autoclean = true |
Toggle automatic cleaning of temporary files (enabled by default) | |
std::string | m_palette |
The name of the gnuplot palette to be used. | |
std::size_t | m_width = 0 |
The size of the plot in x. | |
std::size_t | m_height = 0 |
The size of the plot in y. | |
std::string | m_datafilename |
The multi data set file where data given to plot (e.g., vectors) are saved. | |
std::string | m_data |
The current plot data as a string. | |
std::size_t | m_numdatasets = 0 |
The current number of data sets in the data file. | |
FontSpecs | m_font |
The font name and size in the plot. | |
BorderSpecs | m_border |
The border style of the plot. | |
GridSpecs | m_grid |
The vector of grid specs for the major and minor grid lines in the plot (for xtics, ytics, mxtics, etc.). | |
std::string | m_xrange |
The x-range of the plot as a gnuplot formatted string (e.g., "set xrange [0:1]") | |
std::string | m_yrange |
The y-range of the plot as a gnuplot formatted string (e.g., "set yrange [0:1]") | |
HistogramStyleSpecs | m_style_histogram |
The specs for the histogram style of the plot. | |
TicsSpecs | m_tics |
The specs of the tics of the plot. | |
TicsSpecsMajor | m_xtics_major_bottom |
The specs for the major xtics at the bottom. | |
TicsSpecsMajor | m_xtics_major_top |
The specs for the major xtics at the top. | |
TicsSpecsMinor | m_xtics_minor_bottom |
The specs for the minor xtics at the bottom. | |
TicsSpecsMinor | m_xtics_minor_top |
The specs for the minor xtics at the top. | |
TicsSpecsMajor | m_ytics_major_left |
The specs for the major ytics at the left. | |
TicsSpecsMajor | m_ytics_major_right |
The specs for the major ytics at the right. | |
TicsSpecsMinor | m_ytics_minor_left |
The specs for the minor ytics at the left. | |
TicsSpecsMinor | m_ytics_minor_right |
The specs for the minor ytics at the right. | |
TicsSpecsMajor | m_ztics_major |
The specs for the major ztics. | |
TicsSpecsMinor | m_ztics_minor |
The specs for the minor ztics. | |
TicsSpecsMajor | m_rtics_major |
The specs for the major rtics. | |
TicsSpecsMinor | m_rtics_minor |
The specs for the minor rtics. | |
AxisLabelSpecs | m_xlabel |
The label of the x-axis. | |
AxisLabelSpecs | m_ylabel |
The label of the y-axis. | |
AxisLabelSpecs | m_rlabel |
The label of the r-axis. | |
std::string | m_boxwidth |
The default width of boxes in plots containing boxes without given widths. | |
FillStyleSpecs | m_style_fill |
The specs for the fill style of the plot elements in the plot that can be painted. | |
std::string | m_samples |
The number of sample points for functions. | |
LegendSpecs | m_legend |
The legend specs of the plot. | |
std::vector< DrawSpecs > | m_drawspecs |
The plot specs for each call to gnuplot plot function. | |
std::vector< std::string > | m_customcmds |
The strings containing gnuplot custom commands. | |
Static Protected Attributes inherited from Plot | |
static std::size_t | m_counter = 0 |
Counter of how many plot / singleplot objects have been instanciated in the application. | |
Detailed Description
The class used to create a plot containing graphical elements.
The documentation for this class was generated from the following file:
- sciplot/Plot2D.hpp