diff --git a/dumux/io/gnuplotinterface.hh b/dumux/io/gnuplotinterface.hh index e69cb112a240ebbaa2d65e2d0eaeb18c32ca3345..d89acee9bed6caee852be52eecccc4f7d0e5c292 100644 --- a/dumux/io/gnuplotinterface.hh +++ b/dumux/io/gnuplotinterface.hh @@ -73,8 +73,7 @@ public: xLabel_(""), yLabel_(""), options_(""), datafileSeparator_(' '), - gnuplotPath_(GNUPLOT_EXECUTABLE), - terminalType_("wxt") + gnuplotPath_(GNUPLOT_EXECUTABLE) { if (persist) pipe_ = popen((gnuplotPath_ + " -persist").c_str(), "w"); // "w" - writing @@ -95,12 +94,13 @@ public: * \param title The name of the output file * \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 std::string plot = "reset\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) { plot += "set xrange [" + convertToString(xRangeMin_) @@ -338,7 +338,6 @@ private: std::string options_; char datafileSeparator_; std::string gnuplotPath_; - std::string terminalType_; }; } // end of namespace #endif // DUMUX_GNUPLOT_INTERFACE_HH diff --git a/test/io/gnuplotinterface/test_gnuplotinterface.cc b/test/io/gnuplotinterface/test_gnuplotinterface.cc index 1a285b96ec5befc18910a3040c567bd011527b66..1aba04589bce71086d42fe63a2c8381b76fbd816 100644 --- a/test/io/gnuplotinterface/test_gnuplotinterface.cc +++ b/test/io/gnuplotinterface/test_gnuplotinterface.cc @@ -58,7 +58,7 @@ int main() gnuplot.setOption("set label 'arrow' at 1,15 center tc rgb 'dark-gray'"); gnuplot.addDataSetToPlot(x, y, "dataSet_f(x)=x^2", "every 5 w lp ps 2"); gnuplot.addFunctionToPlot("x**3", "function_f(x)=x^3"); - gnuplot.addFileToPlot("0_dataSet_f(x)=x^2.dat", "file_f(x)=x^2.dat"); + gnuplot.addFileToPlot("dataSet_f(x)=x^2.dat", "file_f(x)=x^2.dat"); gnuplot.plot("plot"); exit(0); }