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

Impulse type plot

This commit is contained in:
Antonin Portelli 2019-03-09 22:45:44 +00:00
parent be14739695
commit 1a5d263512
2 changed files with 30 additions and 0 deletions

View File

@ -261,6 +261,27 @@ PlotHistogram::PlotHistogram(const Histogram &h)
setCommand("'" + tmpFileName + "' u 1:2 w steps");
}
// PlotImpulses constructor ////////////////////////////////////////////////////
PlotImpulses::PlotImpulses(const DVec &x, const DVec &y)
{
if (x.rows() != y.rows())
{
LATAN_ERROR(Size, "x and y vector does not have the same size");
}
DMat d(x.rows(), 2);
string tmpFileName;
for (Index i = 0; i < x.rows(); ++i)
{
d(i, 0) = x(i);
d(i, 1) = y(i);
}
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' u 1:2 w impulses");
}
// PlotMatrixNoRange constructor ///////////////////////////////////////////////
PlotMatrixNoRange::PlotMatrixNoRange(const DMat &m)
{

View File

@ -146,6 +146,15 @@ public:
virtual ~PlotHistogram(void) = default;
};
class PlotImpulses: public PlotObject
{
public:
// constructor
PlotImpulses(const DVec &x, const DVec &y);
// destructor
virtual ~PlotImpulses(void) = default;
};
class PlotMatrixNoRange: public PlotObject
{
public: