sciplot  0.3.1
A modern C++ plotting library powered by gnuplot
Plot3D Class Reference

The class used to create a plot containing graphical elements. More...

#include <Plot3D.hpp>

Inheritance diagram for Plot3D:
[legend]
Collaboration diagram for Plot3D:
[legend]

Public Member Functions

 Plot3D ()
 Construct a default Plot object.
 
auto zlabel (const std::string &label) -> AxisLabelSpecs &
 Set the label of the z-axis and return a reference to the corresponding specs object.
 
auto zrange (StringOrDouble min, StringOrDouble max) -> void
 Set the z-range of the plot (also possible with empty values or autoscale options (e.g. "", "*")).
 
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 Y , typename Z >
auto drawCurve (const X &x, const Y &y, const Z &z) -> DrawSpecs &
 Draw a curve with given x and y vectors.
 
template<typename X , typename Y , typename Z >
auto drawCurveWithPoints (const X &x, const Y &y, const Z &z) -> DrawSpecs &
 Draw a curve with points with given x and y vectors.
 
template<typename X , typename Y , typename Z >
auto drawDots (const X &x, const Y &y, const Z &z) -> DrawSpecs &
 Draw dots with given x and y vectors.
 
template<typename X , typename Y , typename Z >
auto drawPoints (const X &x, const Y &y, const Z &z) -> DrawSpecs &
 Draw points with given x and y vectors.
 
template<typename X , typename Y , typename Z >
auto drawImpulses (const X &x, const Y &y, const Z &z) -> 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, const ColumnIndex &col, const ColumnIndex &ycol) -> DrawSpecs &
 Draw a curve with given values at xcol and ycol columns in file fname.
 
auto drawCurveWithPoints (const std::string &fname, const ColumnIndex &xcol, const ColumnIndex &ycol) -> DrawSpecs &
 Draw a curve with points with given values at xcol and ycol columns in file fname.
 
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 (const 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< DrawSpecsm_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: