Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

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

#!/usr/bin/gnuplot

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

plot x, \
     x*x, \
     x*x*x,
share|improve this answer
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.