current state
This commit is contained in:
@@ -19,6 +19,7 @@ private:
|
||||
K::GnuplotPlotElementLines lineErr[8];
|
||||
K::GnuplotPlotElementLines lineB;
|
||||
K::GnuplotPlotElementLines lineC;
|
||||
std::string codeFile;
|
||||
|
||||
public:
|
||||
|
||||
@@ -40,6 +41,25 @@ public:
|
||||
|
||||
}
|
||||
|
||||
void clear() {
|
||||
for (int i = 0; i < 8; ++i) {lineErr[i].clear();}
|
||||
lineB.clear();
|
||||
lineC.clear();
|
||||
}
|
||||
|
||||
void writeCodeTo(const std::string& file) {
|
||||
this->codeFile = file;
|
||||
}
|
||||
|
||||
void writeEpsTex(const std::string file, K::GnuplotSize size = K::GnuplotSize(8.5, 5.1)) {
|
||||
gp.setTerminal("epslatex", size);
|
||||
gp.setOutput(file);
|
||||
gp << "set key\n";
|
||||
gp << "set rmargin 0.2\n";
|
||||
gp << "set tmargin 0.2\n";
|
||||
gp << "set bmargin 1.2\n";
|
||||
}
|
||||
|
||||
K::GnuplotPlot& getPlot() {
|
||||
return gpplot;
|
||||
}
|
||||
@@ -63,6 +83,11 @@ public:
|
||||
|
||||
void plot() {
|
||||
gp.draw(gpplot);
|
||||
if (codeFile != "") {
|
||||
std::ofstream out(codeFile);
|
||||
out << gp.getBuffer();
|
||||
out.close();
|
||||
}
|
||||
gp.flush();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user