mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-10 19:20:44 +01:00
Plot: horizontal lines and axis labels
This commit is contained in:
parent
80ec189b91
commit
60a010b592
18
lib/Plot.cpp
18
lib/Plot.cpp
@ -111,6 +111,12 @@ PlotData::PlotData(const XYStatData &data, const Index i, const Index j)
|
|||||||
setCommand("'" + tmpFileName + "' " + usingCmd);
|
setCommand("'" + tmpFileName + "' " + usingCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PlotHLine constructor ///////////////////////////////////////////////////////
|
||||||
|
PlotHLine::PlotHLine(const double y)
|
||||||
|
{
|
||||||
|
setCommand(strFrom(y));
|
||||||
|
}
|
||||||
|
|
||||||
// PlotFunction constructor ////////////////////////////////////////////////////
|
// PlotFunction constructor ////////////////////////////////////////////////////
|
||||||
PlotFunction::PlotFunction(const DoubleFunction &function, const double xMin,
|
PlotFunction::PlotFunction(const DoubleFunction &function, const double xMin,
|
||||||
const double xMax, const unsigned int nPoint)
|
const double xMax, const unsigned int nPoint)
|
||||||
@ -173,6 +179,18 @@ void Caption::operator()(PlotOptions &option) const
|
|||||||
option.caption = caption_;
|
option.caption = caption_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Label constructor ///////////////////////////////////////////////////////////
|
||||||
|
Label::Label(const string &label, const Axis axis)
|
||||||
|
: label_(label)
|
||||||
|
, axis_(axis)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// Label modifier //////////////////////////////////////////////////////////////
|
||||||
|
void Label::operator()(PlotOptions &option) const
|
||||||
|
{
|
||||||
|
option.label[static_cast<int>(axis_)] = label_;
|
||||||
|
}
|
||||||
|
|
||||||
// Color constructor ///////////////////////////////////////////////////////////
|
// Color constructor ///////////////////////////////////////////////////////////
|
||||||
Color::Color(const string &color)
|
Color::Color(const string &color)
|
||||||
: color_(color)
|
: color_(color)
|
||||||
|
23
lib/Plot.hpp
23
lib/Plot.hpp
@ -81,6 +81,15 @@ public:
|
|||||||
virtual ~PlotData(void) = default;
|
virtual ~PlotData(void) = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PlotHLine: public PlotObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructor
|
||||||
|
PlotHLine(const double y);
|
||||||
|
// destructor
|
||||||
|
virtual ~PlotHLine(void) = default;
|
||||||
|
};
|
||||||
|
|
||||||
class PlotFunction: public PlotObject
|
class PlotFunction: public PlotObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -146,6 +155,20 @@ private:
|
|||||||
const std::string caption_;
|
const std::string caption_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Label: public PlotModifier
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// constructor
|
||||||
|
explicit Label(const std::string &label, const Axis axis);
|
||||||
|
// destructor
|
||||||
|
virtual ~Label(void) = default;
|
||||||
|
// modifier
|
||||||
|
virtual void operator()(PlotOptions &option) const;
|
||||||
|
private:
|
||||||
|
const std::string label_;
|
||||||
|
const Axis axis_;
|
||||||
|
};
|
||||||
|
|
||||||
class Color: public PlotModifier
|
class Color: public PlotModifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user