Interface for passing data sets to a file and plotting them, if gnuplot is installed. More...
#include <dumux/io/gnuplotinterface.hh>
Interface for passing data sets to a file and plotting them, if gnuplot is installed.
Public Types | |
enum class | CurveType { function , file , data } |
using | StringVector = std::vector< std::string > |
using | CurveTypeVector = std::vector< CurveType > |
Public Member Functions | |
GnuplotInterface (bool persist=true) | |
The constructor. More... | |
~GnuplotInterface () | |
The destructor. More... | |
void | plot (const std::string &filename="") |
Plots the files for a specific window number, writes a gnuplot and png file. More... | |
void | resetAll (const bool persist=true) |
Resets all gnuplot parameters. More... | |
void | resetPlot () |
Deletes all plots from a plotting window and resets user-defined options. More... | |
void | open (const bool persist=true) |
Opens gnuplot. More... | |
void | close () |
Closes gnuplot. More... | |
void | addFunctionToPlot (const std::string &function, const std::string &options="with lines") |
Adds a function to list of plots. More... | |
void | addFileToPlot (const std::string &fileName, const std::string &options="with lines") |
Adds a file to list of plots. More... | |
void | addDataSetToPlot (const std::vector< Scalar > &x, const std::vector< Scalar > &y, const std::string &fileName, const std::string &options="with lines") |
Adds a data set and writes a data file. More... | |
void | setXlabel (const std::string &label) |
Sets the label for the x-axis. More... | |
void | setYlabel (const std::string &label) |
Sets the label for the y-axis. More... | |
void | setXRange (Scalar min, Scalar max) |
Sets the range for the x-axis. More... | |
void | setYRange (Scalar min, Scalar max) |
Sets the range for the y-axis. More... | |
void | setOption (const std::string &option) |
Sets additional user-defined options. More... | |
void | setOpenPlotWindow (bool openPlotWindow) |
Define whether the gnuplot window should be opened. More... | |
void | setCreateImage (bool createImage) |
Define whether gnuplot should create .png files. More... | |
void | setDatafileSeparator (char separator) |
Sets the datafile separator. More... | |
void | setTerminalType (std::string terminal) |
Sets the terminal used for interactive output. More... | |
void | setOutputDirectory (const std::string &outputDirectory) |
Sets the output directory for data and gnuplot files. More... | |
void | useDashedLines (bool dashed) |
Use dashed (true) or solid (false) lines. More... | |
using Dumux::GnuplotInterface< Scalar >::CurveTypeVector = std::vector<CurveType> |
using Dumux::GnuplotInterface< Scalar >::StringVector = std::vector<std::string> |
|
strong |
|
inlineexplicit |
The constructor.
|
inline |
The destructor.
|
inline |
Adds a data set and writes a data file.
The title of the plot can be changed by setting the title in the options
x | Vector containing the x-axis data points |
y | Vector containing the y-axis data points |
fileName | The name of the written data file |
options | Specific gnuplot options passed to this plot |
|
inline |
Adds a file to list of plots.
fileName | Name and path of the file to be plotted |
options | Specific gnuplot options passed to this plot |
|
inline |
Adds a function to list of plots.
function | Function to be plotted |
options | Specific gnuplot options passed to this plot |
|
inline |
Closes gnuplot.
|
inline |
Opens gnuplot.
|
inline |
Plots the files for a specific window number, writes a gnuplot and png file.
filename | The name of the output file |
|
inline |
Resets all gnuplot parameters.
|
inline |
Deletes all plots from a plotting window and resets user-defined options.
|
inline |
Define whether gnuplot should create .png files.
createImage | Create an image or not |
|
inline |
Sets the datafile separator.
separator | The separator sign between two data columns |
|
inline |
Define whether the gnuplot window should be opened.
openPlotWindow | Open gnuplot or not |
|
inline |
Sets additional user-defined options.
option | Additional line of option in gnuplot language |
|
inline |
Sets the output directory for data and gnuplot files.
outputDirectory | The user-specified terminal |
|
inline |
Sets the terminal used for interactive output.
terminal | The user-specified terminal |
|
inline |
Sets the label for the x-axis.
label | The label of the x-axis |
|
inline |
Sets the range for the x-axis.
min | The lowest plotted value for the x-axis |
max | The highest plotted value for the x-axis |
|
inline |
Sets the label for the y-axis.
label | The label of the y-axis |
|
inline |
Sets the range for the y-axis.
min | The lowest plotted value for the y-axis |
max | The highest plotted value for the y-axis |
|
inline |
Use dashed (true) or solid (false) lines.
dashed | Use dashed lines |