Minimal GnuPlot intro

From Wikiid
Jump to: navigation, search

I use gnuplot sufficiently rarely that I can never remember how to drive it from one session to the next. Here is a really minimal 'getting started (again)' guide:

  % gnuplot
  gnuplot> set terminal gif
  gnuplot> set output 'myplot.gif'
  gnuplot> plot 'myfile.dat' with lines
  gnuplot> quit

...will take 'myfile.dat' - which contains two columns of numbers for X and Y coordinates - and will plot them with some sort of reasonable axes and put the result out into a '.gif' file called 'myplot.gif'.

Neither the 'man' nor 'info' pages are very friendly (like it would be nice to have some decent examples so I can do the basic stuff without having to relearn the entire package!) and the 'gnuplot --help' thing is useless. The interactive help feature is best:

  % gnuplot
  gnuplot> help


  gnuplot> help command best.