Class for plotting data with GNUplot.
This is a basic utility class which saves a temporary gpl file on disk and then calls the GNUplot utility from the system shell, so it does not require to link GNUplot libraries. If the GNUplot is not installed, simply nothing happens. Notes:
- requires GNUplot version 4.6 or newer.
- the GNUplot executable must be available from a command window (make sure the executable inb is in the search path).
- if no plot is displayed, open a cmd shell, type "gnuplot __tmp_gnuplot.gpl -persist" and see which error is displayed.
|
| ChGnuPlot (const std::string &filename="__tmp_gnuplot.gpl") |
|
void | SetPersist (bool persist) |
| Enable/disable persistent plots (default: true). More...
|
|
void | SetCommand (const std::string &command) |
| Add arbitrary GnuPlot commands in the gnuplot script. More...
|
|
ChGnuPlot & | operator<< (const std::string &command) |
| This is equivalent to SetCommand().
|
|
void | Plot (const std::string &datfile, int colX, int colY, const std::string &title, const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from an external file.
|
|
void | Plot (ChVectorDynamic<> &x, ChVectorDynamic<> &y, const std::string &title="", const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from two dynamic Eigen vectors.
|
|
void | Plot (ChMatrixConstRef data, int colX, int colY, const std::string &title="", const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from two columns of a matrix.
|
|
void | Plot (ChFunctionInterp &fun_table, const std::string &title="", const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from a ChFunctionInterp.
|
|
void | Plot (const std::vector< double > &vals_x, const std::vector< double > &vals_y, const std::string &title="", const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from two vectors.
|
|
void | Plot (ChFunction &funct, double xmin, double xmax, double dx, const std::string &title="", const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from a generic ChFunction. More...
|
|
void | Plot (ChFunction &funct, int der_order, double xmin, double xmax, double dx, const std::string &title="", const std::string &customsettings=" with lines ") |
| Plot 2D (x,y) data from a generic ChFunction's 0th, 1st, 2nd, or 3rd derivative.
|
|
void | Replot () |
| Replot last plots (since the last time any of the functions Output*** was used).
|
|
void | SetRangeX (double xmin, double xmax, bool automin=false, bool automax=false) |
| Set the X data range.
|
|
void | SetRangeY (double ymin, double ymax, bool automin=false, bool automax=false) |
| Set the Y data range.
|
|
void | SetRangeY2 (double ymin, double ymax, bool automin=false, bool automax=false) |
| Set the Y2 data range.
|
|
void | SetRangeZ (double zmin, double zmax, bool automin=false, bool automax=false) |
| Set the Z data range.
|
|
void | SetTitle (const std::string &label) |
| Add a plot title.
|
|
void | SetLabelX (const std::string &label) |
| Add a label to the X axis.
|
|
void | SetLabelY (const std::string &label) |
| Add a label to the Y axis.
|
|
void | SetLabelY2 (const std::string &label) |
| Add a label to the Y2 axis.
|
|
void | SetLabelZ (const std::string &label) |
| Add a label to the Z axis.
|
|
void | SetGrid (bool dashed=true, double linewidth=1.0, const ChColor &mcolor=ChColor(0, 0, 0)) |
| Enable and specify parameters for a plot grid.
|
|
void | HideLegend () |
| Hide plot legend.
|
|
void | SetLegend (const std::string &customsettings) |
| Show legend and set optional parameters. More...
|
|
void | SetAxesEqual () |
| Set axes to equal size (i.e., square box).
|
|
void | OutputWindow (int windownum=0) |
| Set plot in a window. More...
|
|
void | OutputPNG (const std::string &filename, int sizex=400, int sizey=300) |
| Save plot in a PNG file. More...
|
|
void | OutputPDF (const std::string &filename) |
| Save plot in a PDF file. More...
|
|
void | OutputEPS (const std::string &filename, double inchsizex=4, double inchsizey=3, bool color=true) |
| Save plot in a EPS file. More...
|
|
void | OutputCustomTerminal (const std::string &filename, const std::string &terminalsetting) |
| Save plot in a custom terminal. More...
|
|
void | FlushPlots () |
| Close current plot command (e.g., for use in multiplot).
|
|