gp.open(where='c:/progra~1/GnuPlot/bin/pgnuplot.exe')
gp.close(pipe=.gp)
gp.send(cmd='replot',pipe=.gp)
gp.plot(x,y,type='p',add=FALSE, title=deparse(substitute(y)),pipe=.gp)gp.open), warning: changing this from the default will
probably break thingsx coordinates to ploty coordinates to plotgp.open returns and invisible copy of the pipe connection
object (to pass to other functions, but don't do this because it
doesn't work right yet).
The other 3 functions don't return anything meaningful. All functions
are run for their side effects.gp.open runs
GnuPlot and establishes a pipe connection, gp.close sends a
quite command to gnuplot and cleans up temporary variables and files,
gp.send sends a command to the GnuPlot process verbatim, and
gp.plot sends data and commands to the process to create a
standard scatterplot or line plot.plotx <- 1:10
y <- 3-2*x+x*x+rnorm(10)
gp.open()
gp.plot(x,y)
gp.send('replot 3-2*x+x**2')
gp.close()Run the code above in your browser using DataLab