SigPack - the C++ signal processing library
latex.cpp
Go to the documentation of this file.
1 
25 #include "sigpack.h"
26 using namespace arma;
27 using namespace sp;
28 
29 int 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 }
int main()
Definition: latex.cpp:29
void set_output(const char *name)
Save plot to file.
Definition: gplot.h:695
Gnuplot class.
Definition: gplot.h:25
Definition: base.h:7
void xlim(const double xmin, const double xmax)
Set X-axis range.
Definition: gplot.h:287
void plot_show(void)
Show plots.
Definition: gplot.h:395
void label(const double &x, const double &y, const char *label)
Set label at position x,y.
Definition: gplot.h:262
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:316