Re: [R] Make plots with GNUplot. Have anyone tried that?

From: Louise Hoffman <louise.hoffman_at_gmail.com>
Date: Sun, 02 Mar 2008 16:47:48 +0100

> There is a very basic interface between R and gnuplot in the TeachingDemos
> package. Look at the help for gp.plot.
[snip]

This looks mighty interesting =)

Is it possible to plot "with lines" (gnuplot syntex) so all the data points are connected?

Also is it possible to make it write the output to a pdf file? (I using the gnuplot cvs which have pdfcairo support)

When I try this, it doesn't write the pdf file. it works with gnuplot cvs.

library(TeachingDemos)
fuelData<-read.table('fuel.csv',header=TRUE, sep=',') attach(fuelData)

gp.open(where='/usr/local/bin/gnuplot')
gp.send('set terminal pdfcairo font 'cmr10' size 8cm,4.6cm')
gp.send('set output '../figures/q1-raw-data-gp.pdf'')
gp.send('unset key')
gp.send('set xlabel 'rtime'')
gp.send('set ylabel 'FPI'')
gp.send('set xrange [1979:2005]')
gp.plot(rtime,fpi)
gp.send('unset output')
gp.close()

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 02 Mar 2008 - 15:52:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Mar 2008 - 19:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive