Skip to content
Snippets Groups Projects
Commit 205f9cd1 authored by Timo Koch's avatar Timo Koch
Browse files

[gnuplot] Do not set terminal as default

Gnuplot will pick a default terminal itself. If you
change the number of plotting windows a terminal has to be
specified. If not specified by the user the default is x11.
parent 9794849e
No related branches found
No related tags found
2 merge requests!31Feature/colebrookwhiteboundarylayer,!13[gnuplot] Do not set terminal as default
...@@ -73,8 +73,7 @@ public: ...@@ -73,8 +73,7 @@ public:
xLabel_(""), yLabel_(""), xLabel_(""), yLabel_(""),
options_(""), options_(""),
datafileSeparator_(' '), datafileSeparator_(' '),
gnuplotPath_(GNUPLOT_EXECUTABLE), gnuplotPath_(GNUPLOT_EXECUTABLE)
terminalType_("wxt")
{ {
if (persist) if (persist)
pipe_ = popen((gnuplotPath_ + " -persist").c_str(), "w"); // "w" - writing pipe_ = popen((gnuplotPath_ + " -persist").c_str(), "w"); // "w" - writing
...@@ -95,12 +94,13 @@ public: ...@@ -95,12 +94,13 @@ public:
* \param title The name of the output file * \param title The name of the output file
* \param plottingWindowNumber Change the number of the window in which the plot is shown * \param plottingWindowNumber Change the number of the window in which the plot is shown
*/ */
void plot(const std::string &title, const unsigned int plottingWindowNumber = 0) void plot(const std::string &title, const unsigned int plottingWindowNumber = 0, const std::string& terminalType = "x11")
{ {
// set correct terminal and general options // set correct terminal and general options
std::string plot = "reset\n"; std::string plot = "reset\n";
plot += "set datafile separator \'" + convertToString(datafileSeparator_) + "\'\n"; plot += "set datafile separator \'" + convertToString(datafileSeparator_) + "\'\n";
plot += "set term wxt " + convertToString(plottingWindowNumber) + " \n"; if (plottingWindowNumber != 0)
plot += "set term " + terminalType + " " + convertToString(plottingWindowNumber) + " \n";
if (xRangeMin_ < 1e100 || xRangeMax_ > -1e100) if (xRangeMin_ < 1e100 || xRangeMax_ > -1e100)
{ {
plot += "set xrange [" + convertToString(xRangeMin_) plot += "set xrange [" + convertToString(xRangeMin_)
...@@ -338,7 +338,6 @@ private: ...@@ -338,7 +338,6 @@ private:
std::string options_; std::string options_;
char datafileSeparator_; char datafileSeparator_;
std::string gnuplotPath_; std::string gnuplotPath_;
std::string terminalType_;
}; };
} // end of namespace } // end of namespace
#endif // DUMUX_GNUPLOT_INTERFACE_HH #endif // DUMUX_GNUPLOT_INTERFACE_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment