|
golib
0.5
|
Plotting multiple plots in one window (or on one page). More...
#include <gnuplot.h>
Public Member Functions | |
| goMultiPlotter (goSize_t rows, goSize_t cols) | |
| Constructor. More... | |
| goMultiPlotter (goMultiPlotter &) | |
| void | setInputFD (int fd) |
| Set input file descriptor. More... | |
| void | setOutputFD (int fd) |
| Set output file descriptor. More... | |
| goMultiPlotter & | operator= (goMultiPlotter &) |
| void | addPlot (const goSinglePlot &, goSize_t row, goSize_t col, goFloat extentRow=1.0f, goFloat extentCol=1.0f) |
| Add a plot at a given position. More... | |
| void | addPlot (const goSinglePlot &, goSize_t index) |
| void | addPlotBarycentric (goSinglePlot &p, goDouble u, goDouble v, goDouble w, goDouble xsize, goDouble ysize) |
| goSize_t | getRows () const |
| Get number of rows in the multiplot grid. More... | |
| goSize_t | getColumns () const |
| Get number of columns in the multiplot grid. More... | |
| void | setWaitFlag (bool w) |
| Set wait flag (default true). More... | |
| bool | getWaitFlag () const |
| Get wait flag. More... | |
| void | setPauseFlag (bool p) |
| Set pause flag. More... | |
| bool | getPauseFlag () const |
| Get pause flag. More... | |
| void | setSingleFlag (bool s) |
| bool | getSingleFlag () const |
| void | setAutoPosition (bool a) |
| bool | getAutoPosition () const |
| void | setBarycentric (const goMath::Matrixf &triangle) |
| void | setBarycentric (const goMath::Matrixd &triangle) |
| void | setPrefix (const goString &) |
| Set a gnuplot command prefix. More... | |
| void | setPrefix (const char *) |
| void | setPostfix (const goString &) |
| Set a gnuplot command postfix. More... | |
| void | setPostfix (const char *) |
| void | setTitle (const char *) |
| bool | makePlotCommands (goString &plotCommandsRet) |
| virtual bool | plot (goGnuplot *gp=0) |
| Plot all plots. More... | |
| virtual bool | plotPostscript (const goString &filename, goFloat sizeX=-1.0f, goFloat sizeY=-1.0f) |
| Plot to a postscript file. More... | |
| virtual bool | plotEPS (const goString &filename) |
| Plot to a postscript file. More... | |
| virtual bool | plotFile (const goString &filename, const goString &type) |
| Plot to a specified output terminal and pipe output to file. More... | |
| bool | plotPostscript (const char *filename, goFloat sizeX=-1.0f, goFloat sizeY=-1.0f) |
| bool | plotEPS (const char *filename) |
| bool | plotFile (const char *filename, const char *type) |
| bool | saveGnuplot (const char *filename) |
| void | clear () |
| Clears all commands and plots and resets flags to default values. | |
| void | removeFiles () |
| Remove all data and command files. | |
Public Member Functions inherited from goObjectBase | |
| goObjectBase () | |
| Constructor. | |
| virtual | ~goObjectBase () |
| Destructor. More... | |
| const char * | getClassName () const |
| Returns the class name. More... | |
| int | getClassID () const |
| virtual goSize_t | memoryUsage () const |
| Returns the size of this object or some measure of its memory consumption. More... | |
| void | setObjectName (const char *name) |
| Set name string for an object. More... | |
| void | setObjectName (const goString &name) |
| Set name string for an object. More... | |
| const goString & | getObjectName () const |
| Get the object name. More... | |
| virtual bool | writeObjectFile (FILE *) const |
| Write object to a file. More... | |
| virtual bool | readObjectFile (FILE *) |
| Read object from a file. More... | |
| void | connectObject (goObjectBase *object) |
| Connects an object to this object. More... | |
| void | disconnectObject (const goObjectBase *object) |
| Disconnects an object from this object. | |
| virtual bool | callObjectMethod (int methodID, goObjectMethodParameters *param=NULL) |
| Call an object method by identifier. More... | |
| virtual bool | queueObjectMethod (int methodID, goObjectMethodParameters *param=NULL, bool blocking=false) |
| Enqueue a method call to an internal list of methods. More... | |
| bool | callQueuedMethods () |
| Call all queued methods. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from goObjectBase | |
| void | setClassID (int id) |
| Sets the class name. | |
| void | printClassMessage (const char *msg) |
| Sets the class name. More... | |
| void | printClassMessage (goString &msg) |
| Prints an informational message to the calling console. More... | |
| void | sendObjectMessage (int messageID, void *data=NULL) |
| Sends a message to all connected objects. | |
| void | sendObjectMessage (goObjectBase *object, int messageID, void *data=NULL) |
| Sends a message to a specific object. | |
| virtual void | receiveObjectMessage (const goObjectMessage &message) |
| Receive a message. More... | |
Plotting multiple plots in one window (or on one page).
This is the plotting facility that should be used generally. It uses Gnuplot.
Constructor.
Constructs a new goMultiPlotter with multiplot grid size (rows x cols). This means a grid with <rows> rows and <cols> columns of goSinglePlot objects can be drawn by the constructed object.
| rows | Number of rows. |
| cols | Number of columns. |
| void goMultiPlotter::addPlot | ( | const goSinglePlot & | p, |
| goSize_t | row, | ||
| goSize_t | col, | ||
| goFloat | extentRow = 1.0f, |
||
| goFloat | extentCol = 1.0f |
||
| ) |
Add a plot at a given position.
Adds a plot to the multiplot grid.
| p | Plot. |
| row | Row position. |
| col | Column position. |
| goSize_t goMultiPlotter::getColumns | ( | ) | const |
Get number of columns in the multiplot grid.
| bool goMultiPlotter::getPauseFlag | ( | ) | const |
Get pause flag.
| goSize_t goMultiPlotter::getRows | ( | ) | const |
Get number of rows in the multiplot grid.
| bool goMultiPlotter::getWaitFlag | ( | ) | const |
Get wait flag.
|
virtual |
Plot all plots.
| gp | goGnuplot object pointer. If not null, all commands are sent to this object. A command files will then not be written. |
|
virtual |
Plot to a postscript file.
Same as plotFile (filename, goString("postscript eps colour"));
| filename | Postscript file name. |
Plot to a specified output terminal and pipe output to file.
The command "set terminal <type>" is added to the prefix gnuplot command. The plotter (gnuplot) is called through a shell and the shell output is stored in <filename>.
All temporary files created by the plot are removed after plotting.
| filename | Filename to store the shell output in. |
| type | Terminal type (from gnuplot, e.g. "postscript color"). |
|
virtual |
Plot to a postscript file.
Same as plotFile (filename, goString("postscript colour"));
| filename | Postscript file name. |
| sizeX | X size of canvas in cm. |
| sizeY | Y size of canvas in cm. |
| void goMultiPlotter::setInputFD | ( | int | fd | ) |
Set input file descriptor.
Used for IO redirection.
| fd | File descriptor. |
| void goMultiPlotter::setOutputFD | ( | int | fd | ) |
Set output file descriptor.
Used for IO redirection.
| fd | File descriptor. |
| void goMultiPlotter::setPauseFlag | ( | bool | w | ) |
Set pause flag.
If set to true, the plotter (gnuplot) waits for user input (usually <RET> on the console) until the program is resumed. To be precise, the gnuplot command "pause -1" is added at the end of the gnuplot command.
| w | Pause flag. |
| void goMultiPlotter::setPostfix | ( | const goString & | str | ) |
Set a gnuplot command postfix.
This string is appended to the complete command string.
| str | gnuplot commands. |
| void goMultiPlotter::setPrefix | ( | const goString & | p | ) |
Set a gnuplot command prefix.
This string will be at the beginning of the gnuplot command. You can use this e.g. to set things like "unset xtics\nunset ytics\n".
| p | Command string. |
| void goMultiPlotter::setWaitFlag | ( | bool | w | ) |
Set wait flag (default true).
If true, the caller waits for the gnuplot process.
| w | Wait flag. |