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

Plot: bands

This commit is contained in:
Antonin Portelli 2016-06-14 12:33:27 +01:00
parent 7e3ab34a31
commit b925a365e2
2 changed files with 24 additions and 0 deletions

View File

@ -183,6 +183,20 @@ PlotHLine::PlotHLine(const double y)
setCommand(strFrom(y));
}
// PlotHBand constructor ///////////////////////////////////////////////////////
PlotBand::PlotBand(const double xMin, const double xMax, const double yMin,
const double yMax, const double opacity)
{
setCommand("'< printf \"%e %e\\n%e %e\\n%e %e\\n%e %e\\n%e %e\\n\" "
+ strFrom(xMin) + " " + strFrom(yMin) + " "
+ strFrom(xMax) + " " + strFrom(yMin) + " "
+ strFrom(xMax) + " " + strFrom(yMax) + " "
+ strFrom(xMin) + " " + strFrom(yMax) + " "
+ strFrom(xMin) + " " + strFrom(yMin)
+ "' u 1:2 w filledcurves closed fs solid " + strFrom(opacity)
+ " noborder");
}
// PlotFunction constructor ////////////////////////////////////////////////////
PlotFunction::PlotFunction(const DoubleFunction &function, const double xMin,
const double xMax, const unsigned int nPoint)

View File

@ -106,6 +106,16 @@ public:
virtual ~PlotHLine(void) = default;
};
class PlotBand: public PlotObject
{
public:
// constructor
PlotBand(const double xMin, const double xMax, const double yMin,
const double yMax, const double opacity = 0.15);
// destructor
virtual ~PlotBand(void) = default;
};
class PlotFunction: public PlotObject
{
public: