diff --git a/dumux/io/gnuplotinterface.hh b/dumux/io/gnuplotinterface.hh index 9b97a2b90de8f2bbfa65a4f1f980b682c6b7afeb..94bbefd34bafa6d5e0628621871c1acb35cd04d6 100644 --- a/dumux/io/gnuplotinterface.hh +++ b/dumux/io/gnuplotinterface.hh @@ -141,7 +141,7 @@ public: } // live plot of the results if gnuplot is installed -#ifdef HAVE_GNUPLOT + std::string interactivePlot = "reset\n"; // set the terminal if the defaults were overwritten @@ -151,7 +151,6 @@ public: interactivePlot += plot; if (openPlotWindow_) executeGnuplot(interactivePlot.c_str()); -#endif // create a gnuplot file if a filename is specified if (filename.compare("") != 0) @@ -166,11 +165,9 @@ public: file << filePlot; file.close(); - // live plot of the results if gnuplot is installed -#ifdef HAVE_GNUPLOT + // live plot of the results if (createImage_) executeGnuplot(filePlot.c_str()); -#endif } } @@ -412,8 +409,10 @@ private: // Give plot command to gnuplot void executeGnuplot(const std::string& plotCommand) const { +#ifdef HAVE_GNUPLOT fputs((plotCommand + "\n").c_str(), pipe_); fflush(pipe_); +#endif } // Check validity of number diff --git a/test/material/components/plotproperties.cc b/test/material/components/plotproperties.cc index 93f205041f2b2e67991b28793583f65fb1d0235a..c761c9ea4a1e81b4d9d9021a75d37045ea94e13c 100644 --- a/test/material/components/plotproperties.cc +++ b/test/material/components/plotproperties.cc @@ -166,4 +166,5 @@ int main(int argc, char *argv[]) gnuplot.plot(Component::name() + "_" + phaseNames[phaseIdx] + "_" + propertyNames[propertyIdx]); } } + }