Plot3D.hpp
106 auto drawWithCols(const std::string& fname, const std::string& with, const std::vector<ColumnIndex>& cols) -> DrawSpecs&;
109 auto drawCurve(const std::string& fname, const ColumnIndex& col, const ColumnIndex& ycol) -> DrawSpecs&;
112 auto drawCurveWithPoints(const std::string& fname, const ColumnIndex& xcol, const ColumnIndex& ycol) -> DrawSpecs&;
159 inline auto Plot3D::drawWithVecs(const std::string& with, const X& x, const Vecs&... vecs) -> DrawSpecs&
175 use += "xtic(1)"; // this terminates the string with 0:2:3:4:xtic(1), and thus column 1 is used for the xtics
181 // Draw the data saved using a data set with index `m_numdatasets`. Increase number of data sets and set the line style specification (desired behavior is 1, 2, 3 (incrementing as new lines are plotted)).
182 return draw("'" + m_datafilename + "' index " + internal::str(m_numdatasets++), use, with).lineStyle(static_cast<int>(m_drawspecs.size()));
219 return drawWithVecs("", y); // empty string because we rely on `set style data histograms` since relying `with histograms` is not working very well (e.g., empty key/lenged appearing in columnstacked mode).
226 inline auto Plot3D::drawWithCols(const std::string& fname, const std::string& with, const std::vector<ColumnIndex>& cols) -> DrawSpecs&
230 use += col.value + ":"; // e.g., "1:4:5:7:" (where 1 is x, 4 is y, 5 is ylow and 7 is yhigh for a yerrorlines plot)
233 return draw(what, use, with).lineStyle(static_cast<int>(m_drawspecs.size())); // e.g., draw(what="'myfile.dat'", use="1:2", with="lines");
236 inline auto Plot3D::drawCurve(const std::string& fname, const ColumnIndex& xcol, const ColumnIndex& ycol) -> DrawSpecs&
241 inline auto Plot3D::drawCurveWithPoints(const std::string& fname, const ColumnIndex& xcol, const ColumnIndex& ycol) -> DrawSpecs&
246 inline auto Plot3D::drawDots(const std::string& fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs&
251 inline auto Plot3D::drawPoints(const std::string& fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs&
256 inline auto Plot3D::drawImpulses(const std::string& fname, ColumnIndex xcol, ColumnIndex ycol) -> DrawSpecs&
275 script << "#==============================================================================" << std::endl;
277 script << "#==============================================================================" << std::endl;
318 script << "#==============================================================================" << std::endl;
320 script << "#==============================================================================" << std::endl;
327 script << "#==============================================================================" << std::endl;
329 script << "#==============================================================================" << std::endl;
335 script << " " << m_drawspecs[i] << (i < n - 1 ? ", \\\n" : ""); // consider indentation with 4 spaces!
An auxiliary type used to store a string value, while the input can also be a double.
Definition: StringOrDouble.hpp:35
TicsSpecsMajor m_ytics_major_left
The specs for the major ytics at the left.
Definition: Plot.hpp:227
auto drawHistogram(const Y &y) -> DrawSpecs &
Draw a histogram for the given y vector.
Definition: Plot3D.hpp:217
std::string m_xrange
The x-range of the plot as a gnuplot formatted string (e.g., "set xrange [0:1]")
Definition: Plot.hpp:219
std::string m_samples
The number of sample points for functions.
Definition: Plot.hpp:240
The class used to create a plot containing graphical elements.
Definition: Plot3D.hpp:58
std::string m_palette
The name of the gnuplot palette to be used.
Definition: Plot.hpp:210
GridSpecs m_grid
The vector of grid specs for the major and minor grid lines in the plot (for xtics,...
Definition: Plot.hpp:218
FillStyleSpecs m_style_fill
The specs for the fill style of the plot elements in the plot that can be painted.
Definition: Plot.hpp:239
The specifications for an axis label (e.g., xlabel, ylabel, etc.)
Definition: AxisLabelSpecs.hpp:37
TicsSpecsMajor m_xtics_major_top
The specs for the major xtics at the top.
Definition: Plot.hpp:224
auto repr() const -> std::string override
Convert this plot object into a gnuplot formatted string.
Definition: Plot3D.hpp:270
auto drawCurve(const X &x, const Y &y, const Z &z) -> DrawSpecs &
Draw a curve with given x and y vectors.
Definition: Plot3D.hpp:186
TicsSpecsMajor m_ztics_major
The specs for the major ztics.
Definition: Plot.hpp:231
auto zrange(StringOrDouble min, StringOrDouble max) -> void
Set the z-range of the plot (also possible with empty values or autoscale options (e....
Definition: Plot3D.hpp:149
auto zlabel(const std::string &label) -> AxisLabelSpecs &
Set the label of the z-axis and return a reference to the corresponding specs object.
Definition: Plot3D.hpp:143
auto drawCurveWithPoints(const X &x, const Y &y, const Z &z) -> DrawSpecs &
Draw a curve with points with given x and y vectors.
Definition: Plot3D.hpp:192
std::string m_boxwidth
The default width of boxes in plots containing boxes without given widths.
Definition: Plot.hpp:238
An auxiliary type used to represent a data column index.
Definition: ColumnIndex.hpp:35
auto text(std::string text) -> AxisLabelSpecs &
Set the text of the axis label.
Definition: AxisLabelSpecs.hpp:73
TicsSpecsMinor m_xtics_minor_bottom
The specs for the minor xtics at the bottom.
Definition: Plot.hpp:225
TicsSpecsMinor m_ytics_minor_left
The specs for the minor ytics at the left.
Definition: Plot.hpp:229
auto drawPoints(const X &x, const Y &y, const Z &z) -> DrawSpecs &
Draw points with given x and y vectors.
Definition: Plot3D.hpp:205
TicsSpecsMinor m_xtics_minor_top
The specs for the minor xtics at the top.
Definition: Plot.hpp:226
TicsSpecsMinor m_ztics_minor
The specs for the minor ztics.
Definition: Plot.hpp:232
TicsSpecsMajor m_ytics_major_right
The specs for the major ytics at the right.
Definition: Plot.hpp:228
TicsSpecsMajor m_xtics_major_bottom
The specs for the major xtics at the bottom.
Definition: Plot.hpp:223
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)).
Definition: Plot3D.hpp:159
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)).
Definition: Plot3D.hpp:226
std::string m_yrange
The y-range of the plot as a gnuplot formatted string (e.g., "set yrange [0:1]")
Definition: Plot.hpp:220
HistogramStyleSpecs m_style_histogram
The specs for the histogram style of the plot.
Definition: Plot.hpp:221
std::vector< std::string > m_customcmds
The strings containing gnuplot custom commands.
Definition: Plot.hpp:243
auto drawImpulses(const X &x, const Y &y, const Z &z) -> DrawSpecs &
Draw impulses with given x and y vectors.
Definition: Plot3D.hpp:211
The class where options for the plotted element can be specified.
Definition: DrawSpecs.hpp:41
TicsSpecsMinor m_rtics_minor
The specs for the minor rtics.
Definition: Plot.hpp:234
TicsSpecsMajor m_rtics_major
The specs for the major rtics.
Definition: Plot.hpp:233
auto drawDots(const X &x, const Y &y, const Z &z) -> DrawSpecs &
Draw dots with given x and y vectors.
Definition: Plot3D.hpp:199
std::vector< DrawSpecs > m_drawspecs
The plot specs for each call to gnuplot plot function.
Definition: Plot.hpp:242
TicsSpecsMinor m_ytics_minor_right
The specs for the minor ytics at the right.
Definition: Plot.hpp:230