SigPack - the C++ signal processing library
 
Loading...
Searching...
No Matches
latex.cpp
Go to the documentation of this file.
1
25#include "sigpack.h"
26using namespace arma;
27using namespace sp;
28
29int main()
30{
31 int N = 512;
32 vec x(N), y(N);
33 gplot gp;
34 x = linspace(-5, 5, N);
35 y = exp(-(x - 1) % (x - 1) / datum::pi);
36
37 gp.set_output("test.tex");
38 gp.label(-4, 0.5, " $f(x)=e^{-\\\\frac{(x-1)^2}{\\\\pi}} $");
39 gp.xlim(-5, 5);
40 gp.plot_add(x, y, "");
41 gp.plot_show();
42 return 0;
43}
Gnuplot class.
Definition gplot.h:27
void plot_show(void)
Show plots.
Definition gplot.h:401
void set_output(const char *name)
Save plot to file.
Definition gplot.h:690
void xlim(const double xmin, const double xmax)
Set X-axis range.
Definition gplot.h:297
void plot_add(const T1 &x, const T2 &y, const std::string lb, const std::string ls="lines")
Push plot y vs. x with label and linespec.
Definition gplot.h:325
void label(const double &x, const double &y, const char *label)
Set label at position x,y.
Definition gplot.h:272
int main()
Definition latex.cpp:29
Definition base.h:8