See Plot a spiral with gnuplot.

To export the plot in a pdf, try gnuplot commands like this before the plot:

set terminal postscript set output "foobar.ps"
Note the following. If you try this interactively and want to redraw the plot with changed parameters, you might have to issue the set output statement again so that gnuplot reopens the output file, otherwise gnuplot might just append the second plot to the file and you'll get two pages. Note also that if your input contains lots of data points then the postscript file will contain data for all of them, so you might get a very large file that's slow to render even if not much will be visible of it when you eventually view it. To avoid this, either reduce the number of your data points, or output to a raster format (such as PNG) with gnuplot instead, or render the postscript to a raster format with a postscript engine (such as ghostscript) and distribute that image.

Update 2011-10-19: for a code example, see Re: Draw chart.


In reply to Re: Export Plots by ambrus
in thread Export Plots by afalsename

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.