Learn R Programming

Rgnuplot (version 1.0.3)

Gpcmd: Send one or more commands to gnuplot

Description

Gpcmd sends one or more commands to an open gnuplot session

Usage

Gpcmd(handle, cmd, ...)

Arguments

handle
handle to the connection
cmd, ...
cmd is an optional format string as in the printf command, followed by one or more commands

Value

See Also

Gpinit Gpclose

Examples

Run this code
#"Hello World!" - text on legend
#Initialize the gnuplot handle
h1<-Gpinit()
#set output to a postscript file
#Gpcmd(h1,'set terminal postscript eps color;set output "helloworld1.eps"')
#label the x and y axis
GpsetXlabel(h1, 'x')
GpsetYlabel(h1, 'y')
#set plot style to "lines"
Gpsetstyle(h1, 'lines')
#plot and add a legend
## Not run: GpplotEquation(h1,'sin(x)','Hello World!')
# #pause R and gnuplot
# Gppause()## End(Not run)
#close gnuplot handle
h1<-Gpclose(h1)

Run the code above in your browser using DataLab