[Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/)
# JKQtPlotter
## Simple impulse plots
This project (see `./examples/simpletest_impulsesplot/`) simply creates a JKQtPlotter widget (as a new window) and adds a single impulse graph.
The soruce code of the main application is (see [`jkqtplotter_simpletest_impulsesplot.cpp`](https://github.com/jkriege2/JKQtPlotter/blob/master/examples/simpletest_impulsesplot/jkqtplotter_simpletest_impulsesplot.cpp).
First data for a curve is calculated and stored in `QVector<double>`:
```c++
QVector<double> X, Y;
for (int i=0; i<Ndata;i++){
const double xx=double(i)/double(Ndata)*6.0*M_PI;
X <<xx;
Y <<cos(xx)*exp(-xx/10.0);
}
```
... and finally the data is copied into the datastore
```c++
size_t columnX=ds->addCopiedColumn(X, "x");
size_t columnY=ds->addCopiedColumn(Y, "y");
```
Now an impulse graph object is generated and added to the plot: