mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-10 19:20:44 +01:00
Impulse type plot
This commit is contained in:
parent
be14739695
commit
1a5d263512
21
lib/Plot.cpp
21
lib/Plot.cpp
@ -261,6 +261,27 @@ PlotHistogram::PlotHistogram(const Histogram &h)
|
|||||||
setCommand("'" + tmpFileName + "' u 1:2 w steps");
|
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 constructor ///////////////////////////////////////////////
|
||||||
PlotMatrixNoRange::PlotMatrixNoRange(const DMat &m)
|
PlotMatrixNoRange::PlotMatrixNoRange(const DMat &m)
|
||||||
{
|
{
|
||||||
|
@ -146,6 +146,15 @@ public:
|
|||||||
virtual ~PlotHistogram(void) = default;
|
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
|
class PlotMatrixNoRange: public PlotObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user