-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLinePlot.h
More file actions
45 lines (36 loc) · 915 Bytes
/
LinePlot.h
File metadata and controls
45 lines (36 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef LINEPLOT_H
#define LINEPLOT_H
#include "cppCORE_global.h"
#include <QString>
#include <QVector>
///Creates a line plot PNG image (needs Python in the path - and matplotlib extension).
class CPPCORESHARED_EXPORT LinePlot
{
public:
LinePlot();
void addLine(const QVector<double>& values, QString label = "");
void setXValues(const QVector<double>& xvalues);
void setXLabel(QString xlabel);
void setYLabel(QString ylabel);
void setYRange(double ymin, double ymax);
void store(QString filename);
protected:
//line representation
struct PlotLine
{
PlotLine();
PlotLine(const QVector<double>& v, QString l);
QVector<double> values;
QString label;
};
//variables to store the plot data
QVector<PlotLine> lines_;
QVector<double> xvalues_;
QString xlabel_;
QString ylabel_;
double ymin_;
double ymax_;
//variables to store the meta data
bool yrange_set_;
};
#endif // LINEPLOT_H