demo/sinepng.R

# saving a plot to a PNG file (from gnuplot_i examples) Initialize the gnuplot handle
h1 <- Gpinit()
# change gnuplot's working directory to be the same as R's working directory (default)
Gpsetwd(h1)
Gpcmd(h1, "set terminal png")
Gpcmd(h1, "set output \"sine.png\"")
GpplotEquation(h1, "sin(x)", "Sine wave")
# close gnuplot handles
g <- Gpclose(h1)
 

Try the Rgnuplot package in your browser

Any scripts or data that you put into this service are public.

Rgnuplot documentation built on May 1, 2019, 9:17 p.m.