Urbanisme  1.3.0
Projet visant à l'optimisation du placement de routes sur une surface. https://flodavid.github.io/Urbanisme
Fonctions membres publiques | Fonctions membres publiques statiques | Liste de tous les membres
Référence de la classe Gnuplot

The Gnuplot class, can receive parameters, then transmit them to Gnuplot via pipes Pipes are closed when class is destroyed. Plus de détails...

#include <gnuplot_i.hpp>

Fonctions membres publiques

 Gnuplot (const std::string &style="points")
 set a style during construction
 
 Gnuplot (const std::vector< double > &x, const std::string &title="", const std::string &style="points", const std::string &labelx="x", const std::string &labely="y")
 plot a single std::vector at one go
 
 Gnuplot (const std::vector< double > &x, const std::vector< double > &y, const std::string &title="", const std::string &style="points", const std::string &labelx="x", const std::string &labely="y")
 plot pairs std::vector at one go
 
 Gnuplot (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::string &title="", const std::string &style="points", const std::string &labelx="x", const std::string &labely="y", const std::string &labelz="z")
 plot triples std::vector at one go
 
 ~Gnuplot ()
 destructor: needed to delete temporary files
 
Gnuplotcmd (const std::string &cmdstr)
 send a command to gnuplot
 
Gnuplotoperator<< (const std::string &cmdstr)
 Sends a command to an active gnuplot session, identical to cmd() send a command to gnuplot using the << operator. Plus de détails...
 
Gnuplotshowonscreen ()
 sets terminal type to terminal_std
 
Gnuplotsavetops (const std::string &filename="gnuplot_output")
 saves a gnuplot session to a postscript file, filename without extension
 
Gnuplotset_style (const std::string &stylestr="points")
 
Gnuplotset_smooth (const std::string &stylestr="csplines")
 
Gnuplotunset_smooth ()
 unset smooth attention: smooth is not set by default Plus de détails...
 
Gnuplotset_pointsize (const double pointsize=1.0)
 scales the size of the points used in plots
 
Gnuplotset_grid ()
 turns grid on/off
 
Gnuplotunset_grid ()
 grid is not set by default
 
Gnuplotset_multiplot ()
 
Gnuplotunset_multiplot ()
 
Gnuplotset_samples (const int samples=100)
 set sampling rate of functions, or for interpolating data
 
Gnuplotset_isosamples (const int isolines=10)
 set isoline density (grid) for plotting functions as surfaces (for 3d plots)
 
Gnuplotset_hidden3d ()
 
Gnuplotunset_hidden3d ()
 
Gnuplotset_contour (const std::string &position="base")
 
Gnuplotunset_contour ()
 
Gnuplotset_surface ()
 
Gnuplotunset_surface ()
 
Gnuplotset_legend (const std::string &position="default")
 
Gnuplotunset_legend ()
 Switches legend off attention:legend is set by default. Plus de détails...
 
Gnuplotset_title (const std::string &title="")
 sets and clears the title of a gnuplot session Plus de détails...
 
Gnuplotunset_title ()
 Clears the title of a gnuplot session The title is not set by default. Plus de détails...
 
Gnuplotset_ylabel (const std::string &label="x")
 set x axis label
 
Gnuplotset_xlabel (const std::string &label="y")
 set y axis label
 
Gnuplotset_zlabel (const std::string &label="z")
 set z axis label
 
Gnuplotset_xrange (const double iFrom, const double iTo)
 set axis - ranges
 
Gnuplotset_yrange (const double iFrom, const double iTo)
 set y-axis - ranges
 
Gnuplotset_zrange (const double iFrom, const double iTo)
 set z-axis - ranges
 
Gnuplotset_xautoscale ()
 
Gnuplotset_yautoscale ()
 
Gnuplotset_zautoscale ()
 
Gnuplotset_xlogscale (const double base=10)
 turns on/off log scaling for the specified xaxis (logscale is not set by default)
 
Gnuplotset_ylogscale (const double base=10)
 turns on/off log scaling for the specified yaxis (logscale is not set by default)
 
Gnuplotset_zlogscale (const double base=10)
 turns on/off log scaling for the specified zaxis (logscale is not set by default)
 
Gnuplotunset_xlogscale ()
 
Gnuplotunset_ylogscale ()
 
Gnuplotunset_zlogscale ()
 
Gnuplotset_cbrange (const double iFrom, const double iTo)
 set palette range (autoscale by default)
 
Gnuplotplotfile_x (const std::string &filename, const unsigned int column=1, const std::string &title="")
 
template<typename X >
Gnuplotplot_x (const X &x, const std::string &title="")
 from std::vector Plus de détails...
 
Gnuplotplotfile_xy (const std::string &filename, const unsigned int column_x=1, const unsigned int column_y=2, const std::string &title="")
 
template<typename X , typename Y >
Gnuplotplot_xy (const X &x, const Y &y, const std::string &title="")
 from data Plus de détails...
 
Gnuplotplotfile_xy_err (const std::string &filename, const unsigned int column_x=1, const unsigned int column_y=2, const unsigned int column_dy=3, const std::string &title="")
 
template<typename X , typename Y , typename E >
Gnuplotplot_xy_err (const X &x, const Y &y, const E &dy, const std::string &title="")
 from data Plus de détails...
 
Gnuplotplotfile_xyz (const std::string &filename, const unsigned int column_x=1, const unsigned int column_y=2, const unsigned int column_z=3, const std::string &title="")
 
template<typename X , typename Y , typename Z >
Gnuplotplot_xyz (const X &x, const Y &y, const Z &z, const std::string &title="")
 from std::vector
 
Gnuplotplot_slope (const double a, const double b, const std::string &title="")
 plot an equation of the form: y = ax + b, you supply a and b
 
Gnuplotplot_equation (const std::string &equation, const std::string &title="")
 
Gnuplotplot_equation3d (const std::string &equation, const std::string &title="")
 
Gnuplotplot_image (const unsigned char *ucPicBuf, const unsigned int iWidth, const unsigned int iHeight, const std::string &title="")
 plot image Plus de détails...
 
Gnuplotreplot (void)
 replot repeats the last plot or splot command. this can be useful for viewing a plot with different set options, or when generating the same plot for several devices (showonscreen, savetops)
 
Gnuplotreset_plot ()
 resets a gnuplot session (next plot will erase previous ones)
 
Gnuplotreset_all ()
 resets a gnuplot session and sets all variables to default
 
void remove_tmpfiles ()
 deletes temporary files
 
bool is_valid ()
 Is the gnuplot session valid ?? Plus de détails...
 

Fonctions membres publiques statiques

static bool set_GNUPlotPath (const std::string &path)
 optional function: set Gnuplot path manual attention: for windows: path with slash '/' not backslash '\' Plus de détails...
 
static void set_terminal_std (const std::string &type)
 

Description détaillée

The Gnuplot class, can receive parameters, then transmit them to Gnuplot via pipes Pipes are closed when class is destroyed.

Documentation des fonctions membres

bool Gnuplot::is_valid ( )
inline

Is the gnuplot session valid ??

Renvoie
true if valid, false if not
Gnuplot& Gnuplot::operator<< ( const std::string &  cmdstr)
inline

Sends a command to an active gnuplot session, identical to cmd() send a command to gnuplot using the << operator.

Paramètres
cmdstr–> the command string
Renvoie
<– a reference to the gnuplot object
Gnuplot & Gnuplot::plot_equation ( const std::string &  equation,
const std::string &  title = "" 
)

plot an equation supplied as a std::string y=f(x), write only the function f(x) not y= the independent variable has to be x binary operators: ** exponentiation, * multiply, / divide, + add, - substract, % modulo unary operators: - minus, ! factorial elementary functions: rand(x), abs(x), sgn(x), ceil(x), floor(x), int(x), imag(x), real(x), arg(x), sqrt(x), exp(x), log(x), log10(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(y,x), sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x) special functions: erf(x), erfc(x), inverf(x), gamma(x), igamma(a,x), lgamma(x), ibeta(p,q,x), besj0(x), besj1(x), besy0(x), besy1(x), lambertw(x) statistical fuctions: norm(x), invnorm(x)

Gnuplot & Gnuplot::plot_equation3d ( const std::string &  equation,
const std::string &  title = "" 
)

plot an equation supplied as a std::string z=f(x,y), write only the function f(x,y) not z= the independent variables have to be x and y

Gnuplot & Gnuplot::plot_image ( const unsigned char *  ucPicBuf,
const unsigned int  iWidth,
const unsigned int  iHeight,
const std::string &  title = "" 
)

plot image

  • note that this function is not valid for versions of GNUPlot below 4.2
template<typename X >
Gnuplot & Gnuplot::plot_x ( const X &  x,
const std::string &  title = "" 
)

from std::vector

Plots a 2d graph from a list of doubles: x.

template<typename X , typename Y >
Gnuplot & Gnuplot::plot_xy ( const X &  x,
const Y &  y,
const std::string &  title = "" 
)

from data

Plots a 2d graph from a list of doubles: x y.

template<typename X , typename Y , typename E >
Gnuplot & Gnuplot::plot_xy_err ( const X &  x,
const Y &  y,
const E &  dy,
const std::string &  title = "" 
)

from data


plot x,y pairs with dy errorbars

Gnuplot & Gnuplot::plotfile_x ( const std::string &  filename,
const unsigned int  column = 1,
const std::string &  title = "" 
)

plot a single std::vector: x from file

Gnuplot & Gnuplot::plotfile_xy ( const std::string &  filename,
const unsigned int  column_x = 1,
const unsigned int  column_y = 2,
const std::string &  title = "" 
)

plot x,y pairs: x y from file

Gnuplot & Gnuplot::plotfile_xy_err ( const std::string &  filename,
const unsigned int  column_x = 1,
const unsigned int  column_y = 2,
const unsigned int  column_dy = 3,
const std::string &  title = "" 
)

plot x,y pairs with dy errorbars: x y dy from file

Gnuplot & Gnuplot::plotfile_xyz ( const std::string &  filename,
const unsigned int  column_x = 1,
const unsigned int  column_y = 2,
const unsigned int  column_z = 3,
const std::string &  title = "" 
)

plot x,y,z triples: x y z from file

Gnuplot & Gnuplot::set_contour ( const std::string &  position = "base")

enables/disables contour drawing for surfaces (for 3d plot) base, surface, both

bool Gnuplot::set_GNUPlotPath ( const std::string &  path)
static

optional function: set Gnuplot path manual attention: for windows: path with slash '/' not backslash '\'

Paramètres
path–> the gnuplot path
Renvoie
true on success, false otherwise
Gnuplot& Gnuplot::set_hidden3d ( )
inline

enables/disables hidden line removal for surface plotting (for 3d plot)

Renvoie
<– reference to the gnuplot object
Gnuplot & Gnuplot::set_legend ( const std::string &  position = "default")

switches legend on/off position: inside/outside, left/center/right, top/center/bottom, nobox/box

Gnuplot& Gnuplot::set_multiplot ( )
inline

set the mulitplot mode

Renvoie
<– reference to the gnuplot object
Gnuplot & Gnuplot::set_smooth ( const std::string &  stylestr = "csplines")

interpolation and approximation of data, arguments: csplines, bezier, acsplines (for data values > 0), sbezier, unique, frequency (works only with plot_x, plot_xy, plotfile_x, plotfile_xy (if smooth is set, set_style has no effekt on data plotting)

Gnuplot & Gnuplot::set_style ( const std::string &  stylestr = "points")

set line style (some of these styles require additional information): lines, points, linespoints, impulses, dots, steps, fsteps, histeps, boxes, histograms, filledcurves

Gnuplot& Gnuplot::set_surface ( )
inline

enables/disables the display of surfaces (for 3d plot)

Renvoie
<– reference to the gnuplot object
void Gnuplot::set_terminal_std ( const std::string &  type)
static

optional: set standart terminal, used by showonscreen defaults: Windows - win, Linux - x11, Mac - aqua

Paramètres
type–> the terminal type
Renvoie
Gnuplot& Gnuplot::set_title ( const std::string &  title = "")
inline

sets and clears the title of a gnuplot session

Paramètres
title–> the title of the plot [optional, default == ""]
Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::set_xautoscale ( )
inline

autoscale axis (set by default) of xaxis

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::set_yautoscale ( )
inline

autoscale axis (set by default) of yaxis

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::set_zautoscale ( )
inline

autoscale axis (set by default) of zaxis

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_contour ( )
inline

contour is not set by default, it disables contour drawing for surfaces

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_hidden3d ( )
inline

hidden3d is not set by default

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_legend ( )
inline

Switches legend off attention:legend is set by default.

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_multiplot ( )
inline

unsets the mulitplot mode

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_smooth ( )
inline

unset smooth attention: smooth is not set by default

Renvoie
<– a reference to a gnuplot object
Gnuplot& Gnuplot::unset_surface ( )
inline

surface is set by default, it disables the display of surfaces (for 3d plot)

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_title ( )
inline

Clears the title of a gnuplot session The title is not set by default.

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_xlogscale ( )
inline

turns off log scaling for the x axis

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_ylogscale ( )
inline

turns off log scaling for the y axis

Renvoie
<– reference to the gnuplot object
Gnuplot& Gnuplot::unset_zlogscale ( )
inline

turns off log scaling for the z axis

Renvoie
<– reference to the gnuplot object

La documentation de cette classe a été générée à partir du fichier suivant :