1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-10 08:55:37 +00:00

plot data with points

This commit is contained in:
Antonin Portelli 2021-12-20 01:30:26 +01:00
parent adf2c9cc69
commit 60d91cbff5
2 changed files with 27 additions and 0 deletions

View File

@ -224,6 +224,24 @@ PlotLine::PlotLine(const DVec &x, const DVec &y)
setCommand("'" + tmpFileName + "' u 1:2 w lines");
}
// PlotPoints constructor ////////////////////////////////////////////////////////
PlotPoints::PlotPoints(const DVec &x, const DVec &y)
{
if (x.size() != y.size())
{
LATAN_ERROR(Size, "x and y vectors do not have the same size");
}
DMat d(x.size(), 2);
string usingCmd, tmpFileName;
d.col(0) = x;
d.col(1) = y;
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' u 1:2");
}
// PlotHLine constructor ///////////////////////////////////////////////////////
PlotHLine::PlotHLine(const double y)
{

View File

@ -116,6 +116,15 @@ public:
virtual ~PlotLine(void) = default;
};
class PlotPoints: public PlotObject
{
public:
// constructor
PlotPoints(const DVec &x, const DVec &y);
// destructor
virtual ~PlotPoints(void) = default;
};
class PlotBand: public PlotObject
{
public: