33 #ifndef _NSOUND_PLOTTER_H_
34 #define _NSOUND_PLOTTER_H_
48 #if ! ( defined(NSOUND_C_PYLAB) || defined(NSOUND_IN_PYTHON_MODULE) )
85 const std::string & kwargs =
"");
91 const std::string & kwargs =
"");
98 void figure(
const std::string & kwargs=
"")
const;
101 void grid(
boolean flag);
107 void hold(
boolean flag);
112 const std::string & kwargs=
"");
119 const std::string & kwargs=
"");
122 void legend(
const std::string & kwargs=
"");
127 const std::string & fmt =
"",
128 const std::string & kwargs =
"");
134 const std::string & fmt =
"",
135 const std::string & kwargs =
"");
141 const std::string & fmt =
"",
142 const std::string & kwargs =
"");
145 void run_string(
const std::string & command)
const;
149 savefig(
const std::string & filename,
const std::string & kwargs =
"");
172 const std::string & kwargs =
"",
173 Axes * sharex = NULL,
174 Axes * sharey = NULL);
180 const std::string &
text,
181 const std::string & kwargs =
"");
184 void title(
const std::string &
title,
const std::string & kwargs=
"");
187 void xlabel(
const std::string & label,
const std::string & kwargs=
"");
190 void ylabel(
const std::string & label,
const std::string & kwargs=
"");
PyObject * makePyIntFromUint32(const uint32 &i) const
Create a PyInt.
void xlabel(const std::string &label, const std::string &kwargs="")
Add a label x axis.
void grid(boolean flag)
Sets the grid state.
PyObject * _make_kwargs(const std::string &kwargs) const
static void show()
Acutally draw the plots to the screen.
void savefig(const std::string &filename, const std::string &kwargs="")
Saves the last figure drawn to filename.
static boolean grid_is_on_
void plot(const Buffer &y, const std::string &fmt="", const std::string &kwargs="")
Plots the Buffer on the current figure.
void axvline(const float64 &x_pos=0.0, const std::string &kwargs="")
Draws a vertical line at x and spans ymin to ymax (ralitive).
void hide()
Hides all plots, prevents any plot window being rendered to the screen. Usefull if only saveing plots...
void figure(const std::string &kwargs="") const
Creates a new figure window to plot in.
void _swig_shadow()
SWIG helper function function to shadow.
A wrapper around a Matplotlib Axes object.
void title(const std::string &title, const std::string &kwargs="")
Add a title to the plot at the top and centered.
std::pair< std::string, PyObject * > StringPyObjectPair
void legend(const std::string &kwargs="")
Shows the legend on the current axes.
void xlim(const float64 &xmin, const float64 &xmax)
Sets the limit for the x & y axis.
PyObject * makePyListFromBuffer(const Buffer &buffer) const
Create a PyList object from a buffer!
static boolean hold_is_on_
void set_yscale(const std::string &s)
Sets the y axis scaling: log or linear.
void set_xscale(const std::string &s)
Sets the x axis scaling: log or linear.
Plotter()
Construct the Plotter.
Axes subplot(const uint32 n_rows, const uint32 n_cols, const uint32 n, const std::string &kwargs="", Axes *sharex=NULL, Axes *sharey=NULL)
Creates a figure in a subplot, subplot(A, B, C, **kwargs)
void ylim(const float64 &ymin, const float64 &ymax)
void imagesc(const AudioStream &Z, const std::string &kwargs="")
Plots the AudioStream like a 2D matrix.
void text(const float64 &x, const float64 &y, const std::string &text, const std::string &kwargs="")
Adds text at the x, y data point.
Plotter & operator=(const Plotter &rhs)
Asignment disabled.
void hold(boolean flag)
Sets the hold state.
Axes & operator=(const Axes &rhs)
static PlotterState state_
void ylabel(const std::string &label, const std::string &kwargs="")
Add a label y axis.
A Buffer for storing audio samples.
void axhline(const float64 &y_pos=0.0, const std::string &kwargs="")
Draws a horizontal line at y and spans xmin to xmax (ralitive).
std::map< std::string, PyObject * > PylabTable
void run_string(const std::string &command) const
executes the python string
virtual ~Plotter()
Deconstruct the Plotter.