#include <gplot.h>

Classes | |
| struct | plot_data_s |
Public Member Functions | |
| gplot () | |
| ~gplot () | |
| void | send2gp (const char *cmdstr) |
| void | flush_cmd_buf (void) |
| void | draw_now (void) |
| void | figure (const int fig) |
| void | window (const int fig, const char *name, const int x, const int y, const int width, const int height) |
| void | window (const char *name, const int x, const int y, const int width, const int height) |
| void | close_window (void) |
| void | grid_on (void) |
| void | grid_off (void) |
| void | xlabel (const char *label) |
| void | ylabel (const char *label) |
| void | label (const double &x, const double &y, const char *label) |
| void | title (const char *name) |
| void | xlim (const double xmin, const double xmax) |
| void | ylim (const double ymin, const double ymax) |
| template<typename T1 , typename T2 > | |
| void | plot_add (const T1 &x, const T2 &y, const std::string lb, const std::string ls="lines") |
| template<typename T1 > | |
| void | plot_add (const T1 &y, const std::string lb, const std::string ls="lines") |
| void | plot_add_mat (const arma::mat &y) |
| void | plot_add_mat (const arma::mat &y, const std::string p_lb) |
| void | plot_show (void) |
| void | plot_clear (void) |
| template<typename T > | |
| void | fast_plot (const arma::Col< T > &x, const std::string fmt_args="with lines") |
| template<typename T > | |
| void | fast_plot (const arma::Col< T > &x, const arma::Col< T > &y, const std::string fmt_args="with lines") |
| template<typename T > | |
| void | image (const arma::Mat< T > &x) |
| template<typename T > | |
| void | image (const arma::Cube< T > &x) |
| template<typename T > | |
| void | mesh (const arma::Mat< T > &x) |
| template<typename T > | |
| void | surf (const arma::Mat< T > &x) |
| void | set_parula_line (void) |
| void | set_jet_line (void) |
| void | set_set1_line (void) |
| void | set_jet_palette (void) |
| void | set_parula_palette (void) |
| void | set_coolwarm_palette (void) |
| void | set_blackbody_palette (void) |
| void | set_output (const char *name) |
| void | reset_term (void) |
| void | set_term (const char *ttype) |
Private Member Functions | |
| template<typename T1 , typename T2 > | |
| void | plot_str2 (const T1 &x, const T2 &y) |
| template<typename T > | |
| std::string | get_type (T x) |
Private Attributes | |
| FILE * | gnucmd |
| std::string | term |
| int | fig_ix |
| int | plot_ix |
| std::vector< plot_data_s > | plotlist |
Implements a class for streaming data to Gnuplot using a pipe. Inspiration from https://code.google.com/p/gnuplot-cpp/
Requires Gnuplot version > 5.0
|
inline |
|
inline |
|
inline |
|
inline |
Plot vector, fast version.
x and y needs to have the same type
| x | x vector |
| y | y vector |
Definition at line 448 of file gplot.h.
References flush_cmd_buf(), get_type(), gnucmd, and send2gp().

|
inline |
Plot vector, fast version.
| x | x vector |
Definition at line 429 of file gplot.h.
References flush_cmd_buf(), get_type(), gnucmd, and send2gp().

|
inline |
|
inline |
Flush command buffer to Gnuplot pipe.
Definition at line 154 of file gplot.h.
References gnucmd.
Referenced by fast_plot(), fast_plot(), image(), image(), and mesh().
|
inlineprivate |
Get type.
| x | x input type |
Definition at line 68 of file gplot.h.
References err_handler.
Referenced by fast_plot(), fast_plot(), image(), image(), and mesh().
|
inline |
|
inline |
Set grid.
Definition at line 229 of file gplot.h.
References send2gp().
Referenced by main().

|
inline |
Plot cube as image.
| x | x matrix (R,G,B) |
Definition at line 489 of file gplot.h.
References flush_cmd_buf(), get_type(), gnucmd, send2gp(), xlim(), and ylim().

|
inline |
Plot mat as image.
| x | x matrix |
Definition at line 471 of file gplot.h.
References flush_cmd_buf(), get_type(), gnucmd, send2gp(), xlim(), and ylim().
Referenced by main(), and main().

|
inline |
|
inline |
Plot mat as mesh.
| x | x matrix |
Definition at line 520 of file gplot.h.
References flush_cmd_buf(), get_type(), gnucmd, and send2gp().
Referenced by surf().

|
inline |
Push plot y vs. x with label and linespec.
| x | x vector |
| y | y vector |
| lb | label |
| ls | line spec |
Definition at line 325 of file gplot.h.
References sp::gplot::plot_data_s::label, sp::gplot::plot_data_s::linespec, plot_ix, plot_str2(), and plotlist.
Referenced by main().

|
inline |
Push plot y vs. x with label and linespec.
| y | y vector |
| lb | label |
| ls | line spec |
Definition at line 343 of file gplot.h.
References sp::gplot::plot_data_s::label, sp::gplot::plot_data_s::linespec, plot_ix, plot_str2(), and plotlist.

|
inline |
Push multiple plot, each row gives a plot without label.
| y | y matrix |
Definition at line 360 of file gplot.h.
References sp::gplot::plot_data_s::label, sp::gplot::plot_data_s::linespec, plot_ix, plot_str2(), and plotlist.
Referenced by main().

|
inline |
Push multiple plot, each row gives a plot with prefix label.
| y | y matrix |
| p_lb | Label prefix |
Definition at line 380 of file gplot.h.
References sp::gplot::plot_data_s::label, sp::gplot::plot_data_s::linespec, plot_ix, plot_str2(), and plotlist.

|
inline |
|
inline |
Show plots.
Definition at line 401 of file gplot.h.
References plot_ix, plotlist, and send2gp().
Referenced by main().

|
inlineprivate |
Plot y vs. x.
| x | x vector |
| y | y vector |
Definition at line 47 of file gplot.h.
References plot_ix, and send2gp().
Referenced by plot_add(), plot_add(), plot_add_mat(), and plot_add_mat().

|
inline |
|
inline |
Send command to Gnuplot pipe.
| cmdstr | Command string |
Definition at line 143 of file gplot.h.
References gnucmd.
Referenced by close_window(), fast_plot(), fast_plot(), figure(), grid_off(), grid_on(), image(), image(), label(), main(), main(), mesh(), plot_show(), plot_str2(), reset_term(), set_blackbody_palette(), set_coolwarm_palette(), set_jet_line(), set_jet_palette(), set_output(), set_parula_line(), set_parula_palette(), set_set1_line(), set_term(), surf(), title(), window(), xlabel(), xlim(), ylabel(), and ylim().
|
inline |
|
inline |
|
inline |
Set linetype to Matlab 'jet' NB! doesn't work with X11 -terminal Data from https://github.com/Gnuplotting/gnuplot-palettes.
Definition at line 560 of file gplot.h.
References send2gp().

|
inline |
Set palette to Matlab 'jet' Data from https://github.com/Gnuplotting/gnuplot-palettes.
Definition at line 603 of file gplot.h.
References send2gp().

|
inline |
Save plot to file.
| name | filename |
Extensions that are supported:
Definition at line 690 of file gplot.h.
References send2gp(), and term.
Referenced by main().

|
inline |
Set linetype to Matlab 'parula' NB! doesn't work with X11 -terminal Data from https://github.com/Gnuplotting/gnuplot-palettes.
Definition at line 545 of file gplot.h.
References send2gp().

|
inline |
Set palette to Matlab 'parula' Data from https://github.com/Gnuplotting/gnuplot-palettes.
Definition at line 622 of file gplot.h.
References send2gp().

|
inline |
Set linetype to Matlab 'parula' NB! doesn't work with X11 -terminal Data from https://github.com/Gnuplotting/gnuplot-palettes.
Definition at line 575 of file gplot.h.
References send2gp().

|
inline |
Set output terminal.
Definition at line 757 of file gplot.h.
References send2gp(), and term.
Referenced by main().

|
inline |
|
inline |
|
inline |
Configure the figure/window - used in Linux environment where no figure numbers are needed.
| name | Window name |
| x | x position of upper left corner |
| y | y position of upper left corner |
| width | width of window |
| height | height of window |
Definition at line 209 of file gplot.h.
References window().

|
inline |
Configure the figure used Windows environment.
| fig | Figure number |
| name | Window name |
| x | x position of upper left corner |
| y | y position of upper left corner |
| width | width of window |
| height | height of window |
Definition at line 190 of file gplot.h.
References fig_ix, send2gp(), and term.
Referenced by main(), main(), and window().

|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
File handle to pipe.
Definition at line 29 of file gplot.h.
Referenced by draw_now(), fast_plot(), fast_plot(), flush_cmd_buf(), gplot(), image(), image(), mesh(), send2gp(), and ~gplot().
|
private |
Definition at line 32 of file gplot.h.
Referenced by gplot(), plot_add(), plot_add(), plot_add_mat(), plot_add_mat(), plot_clear(), plot_show(), and plot_str2().
|
private |
Definition at line 40 of file gplot.h.
Referenced by gplot(), plot_add(), plot_add(), plot_add_mat(), plot_add_mat(), plot_clear(), and plot_show().
|
private |
Definition at line 30 of file gplot.h.
Referenced by close_window(), figure(), gplot(), set_output(), set_term(), and window().