how to save two plots simultaneously in gnuplot
how to save two plots simultaneously in gnuplot
Hiii...
I havebeen trying to plot two curves simultaneously in a single plot to compare them. ie, by the command:
plot "1.txt" w l, "2.txt" w l
now I want to save it, but the usual command for saving is:
set out "1.txt"
but in this case how can I save them together in a same plot?
edit
{}
1 Answer
1
For saving a plot as a file on your disk, you need to setup two things: a terminal
and an output
. Suppose you have configured your plot interactively in a command-line gnuplot session, this is an example:
terminal
output
set terminal png
set output "myplot.png"
replot
unset output
where replot
does what its command name suggests, it repeats the last plot
command - and if that last plot command showed both curves as you wanted it, they will identically show up in the output file. For info on supported terminal types on your system, read help terminal
.
replot
plot
help terminal
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Please click
edit
under your question and prefix lines of code with 4 spaces. Or select multiple lines of code with the mouse and click the{}
formatting button. Welcome to SO.– Mark Setchell
Jul 2 at 10:16