gnuplotGraph: added offset keyword and terminal consistent with gnuplotSetWriter

Resolves bug-report https://bugs.openfoam.org/view.php?id=3527
This commit is contained in:
Henry Weller
2020-08-05 12:03:53 +01:00
parent fdfe5f3517
commit cbad002697

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,11 +42,14 @@ namespace Foam
void Foam::gnuplotGraph::write(const graph& g, Ostream& os) const void Foam::gnuplotGraph::write(const graph& g, Ostream& os) const
{ {
os << "#set term postscript color" << endl os << "set term postscript color" << nl
<< "set output \"" << word(g.title()) << ".ps\"" << endl << "set output \"" << word(g.title()) << ".ps\"" << nl
<< "set title " << g.title() << " 0,0" << endl << "show title" << endl << "set title " << g.title() << " offset 0,0" << nl
<< "set xlabel " << g.xName() << " 0,0" << endl << "show xlabel" << endl << "show title" << nl
<< "set ylabel " << g.yName() << " 0,0" << endl << "show ylabel" << endl << "set xlabel " << g.xName() << " offset 0,0" << nl
<< "show xlabel" << nl
<< "set ylabel " << g.yName() << " offset 0,0" << nl
<< "show ylabel" << nl
<< "plot"; << "plot";
bool firstField = true; bool firstField = true;
@ -61,12 +64,12 @@ void Foam::gnuplotGraph::write(const graph& g, Ostream& os) const
os << "'-' title " << iter()->name() << " with lines"; os << "'-' title " << iter()->name() << " with lines";
} }
os << "; pause -1" << endl; os << "; pause -1" << nl;
forAllConstIter(graph, g, iter) forAllConstIter(graph, g, iter)
{ {
os << endl; os << nl;
writeXY(g.x(), *iter(), os); writeXY(g.x(), *iter(), os);
} }
} }