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

matrix heatmap plot

This commit is contained in:
Antonin Portelli 2016-04-05 12:51:00 +01:00
parent 41ea5c984e
commit f83ee5bf6c
2 changed files with 26 additions and 4 deletions

View File

@ -247,6 +247,14 @@ PlotHistogram::PlotHistogram(const Histogram &h)
setCommand("'" + tmpFileName + "' u 1:2 w steps");
}
// PlotMatrixNoRange constructor ///////////////////////////////////////////////
PlotMatrixNoRange::PlotMatrixNoRange(const DMat &m)
{
string tmpFileName = dumpToTmpFile(m);
setCommand("'" + tmpFileName + "' matrix w image");
}
/******************************************************************************
* Plot modifiers *
******************************************************************************/

View File

@ -49,11 +49,11 @@ public:
// destructor
virtual ~PlotObject(void) = default;
// access
std::string popTmpFile(void);
const std::string & getCommand(void) const;
const std::string & getHeadCommand(void) const;
std::string popTmpFile(void);
const std::string & getCommand(void) const;
const std::string & getHeadCommand(void) const;
// test
bool gotTmpFile(void) const;
bool gotTmpFile(void) const;
protected:
// access
void pushTmpFile(const std::string &fileName);
@ -138,6 +138,20 @@ public:
virtual ~PlotHistogram(void) = default;
};
class PlotMatrixNoRange: public PlotObject
{
public:
// constructor
PlotMatrixNoRange(const DMat &m);
// destructor
virtual ~PlotMatrixNoRange(void) = default;
};
#define PlotMatrix(m)\
PlotRange(Axis::x, -.5, (m).cols() - .5) <<\
PlotRange(Axis::y, -.5, (m).rows() - .5) <<\
PlotMatrixNoRange(m)
/******************************************************************************
* Plot modifiers *
******************************************************************************/