Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
c0f0eec5
Commit
c0f0eec5
authored
Dec 18, 2018
by
Beatrix Becker
Committed by
Martin Schneider
Dec 18, 2018
Browse files
[handbook][io] cleanup gnuplot
parent
8a77e5e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/handbook/4_externaltools.tex
View file @
c0f0eec5
...
...
@@ -46,10 +46,10 @@ Second, you have to define an instance of the class GnuplotInterface (e.g. calle
Dumux::GnuplotInterface<double> gnuplot;
\end{lstlisting}
Extract the variables you want to plot (in the example below
\texttt
{
x
}
and
\texttt
{
y
}
), e.g., after the time loop.
The actual plotting is done using the method of the gnuplot interface.
As an example, to plot the mole fraction of nitrogen (
\texttt
{
y
}
) over time (
\texttt
{
x
}
),
extract the variables after each time step in the time loop.
The actual plotting is done using the method of the gnuplot interface:
Example:
\begin{lstlisting}
[style=DumuxCode]
gnuplot.resetPlot(); // reset the plot
gnuplot.setXRange(0.0, 72000.0); // specify xmin and xmax
...
...
@@ -57,8 +57,8 @@ gnuplot.setYRange(0.0, 1.0); // specify ymin and ymax
gnuplot.setXlabel("time [s]"); // set xlabel
gnuplot.setYlabel("mole fraction mol/mol"); // set ylabel
// set x-values, y-values, the name of the data file and the Gnupot options
gnuplot.addDataSetToPlot(x, y, "N2
_
left
.dat", options);
// set x-values, y-values, the name of the data file and the Gnup
l
ot options
gnuplot.addDataSetToPlot(x, y, "N2.dat", options);
gnuplot.plot("mole
_
fraction
_
N2"); // set the name of the output file
\end{lstlisting}
...
...
Timo Koch
@timok
mentioned in commit
a47c325a
·
Dec 18, 2018
mentioned in commit
a47c325a
mentioned in commit a47c325a10eca6ea83d1b420584b0925f9a4de2f
Toggle commit list
Timo Koch
@timok
mentioned in merge request
!1428 (merged)
·
Dec 18, 2018
mentioned in merge request
!1428 (merged)
mentioned in merge request !1428
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment