In gnuplot, I want to plot many line graph in one window. I drew graph with multiplot but the label names are not displayed properly, label1 and label2 are printed over each other.

How can I solve this issue? Also can I save a figure?

2 Answers 2


I always prefer to make scripts for gnuplot over typing in shell, doing so, you don't need multiplot. Instead, you can run a script like this


set terminal png crop size 1600,600;
set output "figure.png";

plot x, \
     x*x, \

I was unaware of gnuplot's "multiplot" command. It looks like you might be able to do what you want with judicious use of set origin, but I'd advise doing help multiplot and carefully reading what it has to say.

As far as "saving a figure" goes, I can interpret that one of two ways:

  1. Save the entire gnuplot configuration at that moment, including the last "plot" command. You'd do save "somefile.load" at the gnuplot> prompt. At some later time, you would do load "somefile.load" at the gnuplot> prompt to regenerate the whole thing on screen.
  2. Produce a file containing the figure. The file is in some image format like GIF, JPEG, or some printable format like PostScript. Do help set terminal to see how to set the terminal. I'll assume you want PostScript, but you can pick format later:

    gnuplot>set term postscript

    gnuplot> set out "plot.ps"

    gnuplot> replot

    gnuplot> set term X11

You should have a printable PostScript version of your plot in file "plot.ps" To get a GIF image, you'd say set term gif, set out "something.gif", and replot. Sometimes, an output file will be zero bytes until you do set term x11 (or whatever).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .