05.07.2013 Views

Package 'Rgnuplot' - What are R and CRAN?

Package 'Rgnuplot' - What are R and CRAN?

Package 'Rgnuplot' - What are R and CRAN?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Type <strong>Package</strong><br />

Title Rgnuplot, R interface for gnuplot<br />

Version 1.0.0<br />

Encoding UTF-8<br />

SystemRequirements gnuplot<br />

<strong>Package</strong> ‘Rgnuplot’<br />

March 20, 2013<br />

Description Rgnuplot, R interface for gnuplot Based on gnuplot_i<br />

version 1.11, the GPL code from Nicolas Devillard.<br />

License GPL (>= 3)<br />

Depends R (>= 2.7.0)<br />

Enhances colorspace, png, rgdal, sp<br />

Author Göran Högnäs [ths], Nicolas Devillard [aut], Mauricio Galo<br />

[ctb], Patrick J. Bartlein [ctb], Oscar Perpiñán Lamigueiro [ctb], José Gama [aut, cre]<br />

Maintainer José Gama <br />

Repository <strong>CRAN</strong><br />

Repository/R-Forge/Project rgnuplot<br />

Repository/R-Forge/Revision 20<br />

Repository/R-Forge/DateTimeStamp 2013-03-19 21:42:38<br />

Date/Publication 2013-03-20 13:25:10<br />

NeedsCompilation yes<br />

1


2 R topics documented:<br />

R topics documented:<br />

gp.CheckH<strong>and</strong>le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />

gp.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />

gp.cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />

gp.colorhistogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />

gp.cols2rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />

gp.diverging.colormap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />

gp.errmsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />

gp.ext2terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />

gp.file2string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />

gp.fit.allprogress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />

gp.fit.progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />

gp.getfontpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />

gp.getloadpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />

gp.getvariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />

gp.getwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />

gp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />

gp.hexRGB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />

gp.image.crop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />

gp.image.rgbchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20<br />

gp.init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />

gp.init.save.stderr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22<br />

gp.isWindowOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />

gp.killpidX11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />

gp.load.demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24<br />

gp.m<strong>and</strong>el . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25<br />

gp.map.merpar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26<br />

gp.math3d.plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27<br />

gp.matrix2GimpPalette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />

gp.matrix2XYdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />

gp.matrixfile.pad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />

gp.matrixr2gnu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />

gp.pausableterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />

gp.pause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />

gp.pauseX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />

gp.pidX11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />

gp.plot.equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />

gp.plot.once . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />

gp.plot.slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36<br />

gp.plot.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37<br />

gp.plot.xy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />

gp.plotFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />

gp.plotPolyFit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />

gp.PNG2color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />

gp.PNG2RGB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41<br />

gp.PNG4DEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41<br />

gp.R2plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42


gp.CheckH<strong>and</strong>le 3<br />

gp.R2splot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />

gp.resetplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />

gp.RGB2image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />

gp.run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45<br />

gp.set.term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />

gp.set.xlabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />

gp.set.ylabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />

gp.setfontpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48<br />

gp.setloadpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49<br />

gp.setstyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50<br />

gp.setvariable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />

gp.setwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52<br />

gp.show.datafile.binary.filetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53<br />

gp.showterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53<br />

gp.SHP2gnu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54<br />

gp.splot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />

gp.URL2string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56<br />

gp.version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57<br />

gp.WindowStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58<br />

gp.write.multi.csv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59<br />

gp.write.x.csv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59<br />

gp.write.xy.csv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60<br />

gp.X11.present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />

sOp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />

Index 63<br />

gp.CheckH<strong>and</strong>le Check if the gnuplot session h<strong>and</strong>le is valid<br />

Description<br />

Usage<br />

gp.CheckH<strong>and</strong>le checks a gnuplot session h<strong>and</strong>le <strong>and</strong> returns an error message if it is invalid<br />

gp.CheckH<strong>and</strong>le(h<strong>and</strong>le)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

none<br />

Author(s)<br />

Jose’ Gama


4 gp.close<br />

See Also<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.cmd 5<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


6 gp.colorhistogram<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.cols2rows 7<br />

gp.cols2rows convert a file with columns to rows<br />

Description<br />

Usage<br />

gp.cols2rows converts a file with columns yyyy,m1,m2,m3,...,m12 to rows yyyy,m1 yyyy,m3 ...<br />

yyyy,m12 readable by gnuplot<br />

gp.cols2rows(filename, newfile, filecolseparator=’ ’, fileheader = FALSE, newfilerowseparator=’\n\n’<br />

Arguments<br />

Value<br />

filename file with columns yyyy,m1,m2,m3,...,m12<br />

newfile file with rows yyyy,m1 yyyy,m3 ... yyyy,m12<br />

filecolseparator<br />

string that separates the columns<br />

fileheader optional column header<br />

newfilerowseparator<br />

string that separates the rows<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


8 gp.diverging.colormap<br />

nordklimHelsinkiPrecipitation


gp.errmsg 9<br />

gp.errmsg Get gnuplot’s error messages<br />

Description<br />

Usage<br />

gp.errmsg gets gnuplot’s error messages<br />

gp.errmsg(h<strong>and</strong>le)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

string containing gnuplot’s error messages<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


10 gp.file2string<br />

gp.ext2terminal Determine a suitable terminal from a file extension<br />

Description<br />

Usage<br />

gp.ext2terminal<br />

gp.ext2terminal(filetype=’PNG’)<br />

Arguments<br />

Value<br />

filetype file extension<br />

terminal name<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.set.term<br />

gp.file2string Read a text file to a string<br />

Description<br />

Usage<br />

gp.file2string reads the contents of a text file to a string<br />

gp.file2string(mfile)<br />

Arguments<br />

Value<br />

mfile file to be read<br />

none


gp.fit.allprogress 11<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#"Hello World!" - loading <strong>and</strong> executing a gnuplot script from Rgnuplot<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


12 gp.fit.progress<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.fit.progress Get the value of a parameter from a stderr fit file<br />

Description<br />

Usage<br />

gp.fit.progress returns the value of a parameter from a logged stderr fit file<br />

gp.fit.progress(fitprogressfile, fitparameter)<br />

Arguments<br />

Value<br />

fitprogressfile<br />

logged stderr fit file<br />

fitparameter fit parameter<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init


gp.getfontpath 13<br />

gp.getfontpath Get gnuplot’s additional directories, for fonts<br />

Description<br />

Usage<br />

gp.getfontpath lists gnuplot’s additional directories, for fonts<br />

gp.getfontpath(h<strong>and</strong>le)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

String with a list of gnuplot’s additional directories, for fonts<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


14 gp.getloadpath<br />

gp.getloadpath Get gnuplot’s additional directories, for data <strong>and</strong> scripts<br />

Description<br />

Usage<br />

gp.getloadpath gets a list of gnuplot’s additional directories, for data <strong>and</strong> scripts<br />

gp.getloadpath(h<strong>and</strong>le)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

String with a list of gnuplot’s additional directories, for data <strong>and</strong> scripts<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.setloadpath<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.getvariable 15<br />

gp.getvariable Get the value of a system or environment variable<br />

Description<br />

Usage<br />

gp.getvariable returns the value of a system or environment variable<br />

gp.getvariable(h<strong>and</strong>le, variablename)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

variablename system or environment variable name<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.setvariable<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


16 gp.getwd<br />

gp.getwd Get gnuplot’s working directory<br />

Description<br />

Usage<br />

gp.getwd returns gnuplot’s working directory<br />

gp.getwd(h<strong>and</strong>le)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

String with gnuplot’s working directory<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.setwd<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.h 17<br />

gp.h Show gnuplot’s help<br />

Description<br />

Usage<br />

gp.h shows the output from gnuplot’s help comm<strong>and</strong><br />

gp.h(h<strong>and</strong>le, gnustring)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

gnustring string to be searched for by gnuplot’s help system<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


18 gp.image.crop<br />

gp.hexRGB RGB sequence, from decimal to hexadecimal, ready for gnuplot<br />

Description<br />

Usage<br />

gp.hexRGB returns an RGB sequence, from decimal to hexadecimal<br />

gp.hexRGB(r,g=NA,b=NA)<br />

Arguments<br />

Value<br />

r value for red channel<br />

g value for green channel<br />

b value for blue channel<br />

hexadecimal RGB sequence<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.image.rgbchange<br />

gp.image.crop Simple image manipulation<br />

Description<br />

gp.image.crop crops an image gp.image.decimate decimates an image gp.image.flip flips a<br />

png image on the X, Y or XY axis gp.image.plot displays an image file on the screen or to a<br />

chosen terminal except to a file gp.image.resize resizes an image gp.image.rotate rotates an<br />

image gp.image.tile tiles multiple image files together into one gp.image2PNG converts from<br />

any supported format to PNG, the file type is automatically detected gp.image2image converts<br />

from any supported format to other format, the file type is automatically detected


gp.image.crop 19<br />

Usage<br />

gp.image.crop(fileIN, fileOUT,x1,y1,x2,y2, filetype=’PNG’, terminal=NULL)<br />

gp.image.decimate(fileIN, fileOUT, Xdec=2,Ydec=2, filetype=’PNG’, terminal=NULL)<br />

gp.image.flip(fileIN, fileOUT,flipX=TRUE,flipY=FALSE, filetype=’PNG’, terminal=NULL)<br />

gp.image.plot(fileIN,alpha=FALSE, backgroundColor=’’, filetype=’’, terminal=NULL)<br />

gp.image.resize(fileIN, fileOUT,newWidth, newHeight, filetype=’PNG’, terminal=NULL)<br />

gp.image.rotate(fileIN, fileOUT,degrees, filetype=’PNG’, terminal=NULL)<br />

gp.image.tile(fileOUT, matrixFilenamesIn, vectorWidths, vectorHeights, matrixXscale=NULL, matrixYsca<br />

gp.image2PNG(fileIN, fileOUT, optional256=FALSE,alpha=FALSE, backgroundColor=’’)<br />

gp.image2image(fileIN, fileOUT , filetype=’PNG’, terminal=NULL,alpha=FALSE, backgroundColor=’’)<br />

Arguments<br />

Value<br />

fileIN input file name<br />

fileOUT output file name<br />

x1 x coord corner<br />

y1 y coord corner<br />

x2 x coord opposite corner<br />

y2 y coord opposite corner<br />

filetype image file type<br />

terminal terminal name<br />

Xdec x value to decimate<br />

Ydec y value to decimate<br />

flipX boolean, TRUE=flip on the x-axis<br />

flipY boolean, TRUE=flip on the y-axis<br />

alpha value for alpha channel<br />

backgroundColor<br />

value for background color<br />

newWidth new value for the width<br />

newHeight new value for the Height<br />

degrees angle of rotation in degrees<br />

matrixFilenamesIn<br />

matrix with the file names to tile<br />

vectorWidths vector with the widths of the files to tile<br />

vectorHeights vector with the heights of the files to tile<br />

matrixXscale matrix with values for scaling the images in the x-axis<br />

matrixYscale matrix with values for scaling the images in the y-axis<br />

optional256 boolean, TRUE=256 color output<br />

none


20 gp.image.rgbchange<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.image.rgbchange<br />

gp.image.rgbchange Change image colors<br />

Description<br />

Usage<br />

gp.image.rgbchange modifies an image with either a formula for each color component of RGB<br />

or for all gp.image.rgbfalsecolor converts an image from true color to false color <strong>and</strong> vice-versa<br />

gp.image.rgbfiltercolor.blue filters an image using the blue channel gp.image.rgbfiltercolor.green<br />

filters an image using the green channel gp.image.rgbfiltercolor.red filters an image using<br />

the red channel gp.image.rgbfiltercolor.sepia filters an image using a sepia algorithm<br />

gp.image.rgbfiltercolor.sepia2 filters an image using a 2nd sepia algorithm gp.image.rgbgreyscaleBT709<br />

filters an image using greyscale algorithm - BT709 gp.image.rgbgreyscaleLinear filters an image<br />

using greyscale algorithm - linear gp.image.rgbgreyscaleLuminosity filters an image using<br />

greyscale algorithm - luminosity gp.image.rgbgreyscaleRMY filters an image using greyscale algorithm<br />

- RMY gp.image.rgbgreyscaleY filters an image using greyscale algorithm - Y gp.image.rgbgreyscaleavg<br />

filters an image using greyscale algorithm - average<br />

gp.image.rgbchange(fileIN, fileOUT, filetype=’PNG’, terminal=NULL,rgbformula,rgbformulaG=’’,rgbformu<br />

gp.image.rgbfalsecolor(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbfiltercolor.blue(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbfiltercolor.green(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbfiltercolor.red(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbfiltercolor.sepia(fileIN, fileOUT, filetype=’PNG’, terminal=NULL,sepiaDepth=20,sepiaInte<br />

gp.image.rgbfiltercolor.sepia2(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbgreyscaleBT709(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbgreyscaleLinear(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbgreyscaleLuminosity(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbgreyscaleRMY(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbgreyscaleY(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

gp.image.rgbgreyscaleavg(fileIN, fileOUT, filetype=’PNG’, terminal=NULL)<br />

Arguments<br />

fileIN input file name<br />

fileOUT output file name<br />

filetype image file type<br />

terminal terminal name


gp.init 21<br />

Value<br />

rgbformula formula for the 3 RGB channels or for channel R<br />

rgbformulaG formula for for channel G<br />

rgbformulaB formula for for channel B<br />

sepiaDepth depth value for the sepia algorithm<br />

sepiaIntensity intensity value for the sepia algorithm<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.image.plot<br />

gp.init Open a gnuplot session<br />

Description<br />

Usage<br />

gp.init opens a gnuplot session <strong>and</strong> returns a h<strong>and</strong>le for using the session<br />

gp.init(optcmd = "gnuplot")<br />

Arguments<br />

Value<br />

optcmd optional string for opening a gnuplot session<br />

returns a h<strong>and</strong>le to the connection<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.close gp.cmd


22 gp.init.save.stderr<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.isWindowOpen 23<br />

gp.isWindowOpen Check if an X11 window is opened<br />

Description<br />

Usage<br />

gp.isWindowOpen returns TRUE if an X11 window is opened<br />

gp.isWindowOpen(windowid)<br />

Arguments<br />

Value<br />

windowid X11 window id<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.killpidX11 Kill X11 windows<br />

Description<br />

Usage<br />

gp.killpidX11 kills X11 windows (gnuplot), useful for testing purposes only- experimental, use<br />

at your own risk!<br />

gp.killpidX11(windowid=0)<br />

Arguments<br />

Value<br />

windowid X11 window id<br />

none


24 gp.load.demo<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.load.demo Load .dem gnuplot files<br />

Description<br />

Usage<br />

gp.load.demo loads a .dem gnuplot file <strong>and</strong> executes it, allowing pause statements<br />

gp.load.demo(h<strong>and</strong>le, mfile)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

mfile .dem gnuplot file name<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#example of using gp.load.demo <strong>and</strong> gp.readURL2string<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.m<strong>and</strong>el 25<br />

#pause R <strong>and</strong> gnuplot<br />

gp.pause()<br />

# example of gp.readURL2string<br />

#Kuen’s Surface<br />

gpcode


26 gp.map.merpar<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.math3d.plot 27<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.resampleDEM<br />

gp.math3d.plot 3d plots like Mathematica<br />

Description<br />

Usage<br />

gp.math3d.plot<br />

gp.math3d.plot(foo, xrange=c(0,1), yrange=c(0,1))<br />

Arguments<br />

Value<br />

foo mathematical expression<br />

xrange x-axis range<br />

yrange y-axis range<br />

none<br />

Author(s)<br />

See Also<br />

Ben Ruijl <strong>and</strong> Jose’ Gama<br />

gp.colorhistogram


28 gp.matrix2GimpPalette<br />

gp.matrix2GimpPalette Work with palette files<br />

Description<br />

Usage<br />

gp.matrix2GimpPalette saves a matrix into a Gimp palette file (gpl) gp.matrix2palette save a<br />

palette from matrix data with optional palette indeces <strong>and</strong> the option to modify the palette for solid<br />

colors gp.CreateIndexFromMatrixAndPalette from a matrix with RGB colors (decimal 24bit)<br />

from an image file <strong>and</strong> its palette as a vector, create a matrix with indices gp.CreatePaletteFromMatrix<br />

from a matrix with RGB colors (decimal 24bit) from an image file create a palette of 256 colors<br />

(decimal 24bit), as a vector gp.GimpPalette2matrix reads a Gimp palette into a matrix, optionally<br />

the index can be returned too gp.palette.plot plots a palette from an indexed PNG file<br />

gp.show.palette.colornames get gnuplot’s RGB color names as a dataframe - ’ColorName’,’ColorHex’,’R’,’G’,’B’<br />

gp.matrix2GimpPalette(paletteMatrix, gplFileName, GimpColumns=16)<br />

gp.matrix2palette(paletteData, paletteFileName,paletteIndeces=0,SolidColor=FALSE)<br />

gp.CreateIndexFromMatrixAndPalette(matrixRGB, paletteRGB)<br />

gp.CreatePaletteFromMatrix(matrixRGB, sortType=’’)<br />

gp.GimpPalette2matrix(paletteGimp,returnIndex=FALSE)<br />

gp.palette.plot(filepal, sortType=’’, TheGimp=FALSE)<br />

gp.show.palette.colornames()<br />

Arguments<br />

paletteMatrix matrix with palette values<br />

gplFileName palette file from The GIMP<br />

GimpColumns number of columns on gpl file header<br />

paletteData matrix with the palette data<br />

paletteFileName<br />

output palette file<br />

paletteIndeces number of indices<br />

SolidColor boolean, TRUE=solid colors<br />

matrixRGB matrix with RGB true colors<br />

paletteRGB palette file<br />

paletteGimp palette file from The GIMP<br />

returnIndex boolean, TRUE=include the index value


gp.matrix2XYdata 29<br />

Value<br />

filepal palette file<br />

sortType not implemented yet<br />

TheGimp boolean, TRUE=GIMP file<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.resampleDEM<br />

gp.matrix2XYdata Converting a file to X, Y format<br />

Description<br />

Usage<br />

gp.matrix2XYdata converts a file with data in matrix format to an X, Y format readable by gnuplot<br />

gp.matrix2XYdata(fileName1,fileName2,optMatrix=NA,surfacegrid=FALSE,overwrite=TRUE)<br />

Arguments<br />

Value<br />

fileName1 file with data in matrix format<br />

fileName2 file to save the data in X, Y format<br />

optMatrix optional matrix to add to the output file’s 4th data column<br />

surfacegrid if TRUE then the data is in grid format<br />

overwrite if set to TRUE then it will overwrite an existing file without warning<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init


30 gp.matrixfile.pad<br />

gp.matrixfile.pad Working with matrix <strong>and</strong> XY data files<br />

Description<br />

Usage<br />

gp.matrixfile.pad adds 1 row <strong>and</strong> 1 column (by duplicating the last row <strong>and</strong> last column) to a<br />

matrix file gp.saveXYfile saves an R matrix with coords as a XY data file gp.xydata2matrix<br />

converts a file with splot data to a gnuplot matrix file gp.XYcoords.convert.fun reads a XY data<br />

file <strong>and</strong> changes the coords according to 2 functions gp.XYcoords2shpere reads a XY data file <strong>and</strong><br />

changes the coords to fit a sphere<br />

gp.matrixfile.pad(fileIN,fileOUT,overwrite=TRUE)<br />

gp.saveXYfile(Rmatrix,xyfile)<br />

gp.xydata2matrix(fileIN,fileOUT)<br />

gp.XYcoords.convert.fun(xyfile,newxyfile,fun1,fun2,swapXY=FALSE)<br />

gp.XYcoords2shpere(xyfile,newxyfile)<br />

Arguments<br />

Value<br />

fileIN input file name<br />

fileOUT output file name<br />

overwrite boolean, TRUE=overwrite the output file<br />

Rmatrix R matrix<br />

xyfile input XY file name<br />

newxyfile output XY file name<br />

fun1 function for the x values<br />

fun2 function for the y values<br />

swapXY boolean, TRUE=swap x <strong>and</strong> y<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.matrix2GimpPalette


gp.matrixr2gnu 31<br />

gp.matrixr2gnu Save R matrix in gnuplot format<br />

Description<br />

Usage<br />

gp.matrixr2gnu saves an R matrix in a format that can be read by gnuplot<br />

gp.matrixr2gnu(rmatrix, gnufile)<br />

Arguments<br />

Value<br />

rmatrix R matrix<br />

gnufile gnuplot file name<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


32 gp.pause<br />

gp.pausableterm Determine if the current terminal can be paused in synch with R<br />

Description<br />

Usage<br />

Value<br />

gp.pausableterm returns TRUE if the current terminal can be paused<br />

gp.pausableterm()<br />

boolean<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.pause<br />

gp.pause Pauses the system<br />

Description<br />

Usage<br />

gp.pause pauses the system for a number of seconds <strong>and</strong> then waits for the user to press a key,<br />

detecs X11 beforeh<strong>and</strong><br />

gp.pause(delaySecs=2)<br />

Arguments<br />

Value<br />

delaySecs number of seconds to wait<br />

none<br />

Author(s)<br />

Jose’ Gama


gp.pauseX 33<br />

See Also<br />

gp.init<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


34 gp.plot.equation<br />

See Also<br />

gp.init<br />

gp.pidX11 Get the pid from an X11 window<br />

Description<br />

Usage<br />

gp.pidX11 returns the pid from an X11 window (gnuplot)<br />

gp.pidX11(windowid=0)<br />

Arguments<br />

Value<br />

windowid window id (X11)<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.plot.equation Plot the curve of an equation in 2D<br />

Description<br />

Usage<br />

gp.plot.equation plots an expression, data or a function in 2D<br />

gp.plot.equation(h<strong>and</strong>le, equation, title)<br />

Arguments<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

equation equation to be plotted<br />

title title for the graphic


gp.plot.once 35<br />

Value<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


36 gp.plot.slope<br />

Arguments<br />

Value<br />

title title for the graphic<br />

style gnuplot style (lines, points, linespoints, ...)<br />

label.x label for the x-axis<br />

label.y label for the y-axis<br />

x array of doubles for the x-axis<br />

y array of doubles for the y-axis<br />

n number of elements of the list<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.plot.slope Plots a slope<br />

Description<br />

Usage<br />

gp.plot.slope plots a slope from a list of doubles<br />

gp.plot.slope(h<strong>and</strong>le, a, b, title)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

a list of doubles<br />

b number of elements of the list<br />

title title for the graphic<br />

none<br />

Author(s)<br />

Jose’ Gama


gp.plot.x 37<br />

See Also<br />

gp.init<br />

gp.plot.x Plot one list of doubles in 2D<br />

Description<br />

Usage<br />

gp.plot.x plots one list of doubles in 2D<br />

gp.plot.x(h<strong>and</strong>le, d, n, title)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

d list of doubles<br />

n number of elements of the list<br />

title title for the graphic<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init


38 gp.plotFunction<br />

gp.plot.xy Plot two list of doubles in 2D<br />

Description<br />

Usage<br />

gp.plot.xy plots two list of doubles in 2D<br />

gp.plot.xy(h<strong>and</strong>le, x, y, n, title)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

x list of doubles for the x-axis<br />

y list of doubles for the y-axis<br />

n number of elements of the list<br />

title title for the graphic<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.plotFunction Plots an expression in one function call<br />

Description<br />

Usage<br />

gp.plotFunction plots an expression without the need to define h<strong>and</strong>les<br />

gp.plotFunction(x, xlab=’x’, ylab=’y’, main=’’, type=’l’,...)


gp.plotPolyFit 39<br />

Arguments<br />

Value<br />

x expression<br />

xlab label for the x-axis<br />

ylab label for the y-axis<br />

main main title for the graphic<br />

type type of plot: lines or points<br />

... extra parameters passed to the function<br />

none<br />

Author(s)<br />

See Also<br />

Oscar Perpi\~n\’an Lamigueiro<br />

gp.init<br />

Examples<br />

## Not run: gp.plotFunction (’sin(x)’, ’x’, ’y’, ’sine function’)<br />

gp.plotPolyFit Plots a polynomial fit in one function call<br />

Description<br />

Usage<br />

gp.plotPolyFit Plots a polynomial fit without the need to define h<strong>and</strong>les<br />

gp.plotPolyFit(x, y, order)<br />

Arguments<br />

Value<br />

x array with the values of x<br />

y array with the values of y = f(x)<br />

order order of the polynomial<br />

none


40 gp.PNG2color<br />

Author(s)<br />

See Also<br />

Oscar Perpi\~n\’an Lamigueiro<br />

gp.init<br />

Examples<br />

polnorder


gp.PNG2RGB 41<br />

gp.PNG2RGB Convert PNG to RGB<br />

Description<br />

Usage<br />

gp.PNG2RGB converts a PNG file to an RGB or RGBA file<br />

gp.PNG2RGB(PNGfile, RGBfile,forceRGB=FALSE)<br />

Arguments<br />

Value<br />

PNGfile PNG file<br />

RGBfile RGB or RGBA file<br />

forceRGB if forceRGB is TRUE then the alpha channel is ignored<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.PNG4DEM Convert PNG plus DEM to text<br />

Description<br />

Usage<br />

gp.PNG4DEM converts a PNG file <strong>and</strong> a DEM tab separated to a text format readable by gnuplot<br />

gp.PNG4DEM(filePNG, fileDEMtab, file3Ddat)<br />

Arguments<br />

filePNG PNG file<br />

fileDEMtab DEM tab separated file<br />

file3Ddat text file (gnuplot)


42 gp.R2plot<br />

Value<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.R2plot Save 2D R to gnuplot<br />

Description<br />

Usage<br />

gp.R2plot saves the output from a 2D R function to a file readable by gnuplot<br />

gp.R2plot(Rfunction,filename,gnuxrange,gnuyrange,gnusamples)<br />

Arguments<br />

Value<br />

Rfunction 2D R function<br />

filename file name (gnuplot)<br />

gnuxrange gnuplot xrange<br />

gnuyrange gnuplot yrange<br />

gnusamples gnuplot samples<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init


gp.R2splot 43<br />

gp.R2splot Save 3D R to gnuplot<br />

Description<br />

Usage<br />

gp.R2splot saves the output from a 3D R function to a file readable by gnuplot<br />

gp.R2splot(Rfunction,filename,gnuxrange,gnuyrange,gnusamples,gnuisosamples,hidden3d=FALSE)<br />

Arguments<br />

Value<br />

Rfunction 2D R function<br />

filename file name (gnuplot)<br />

gnuxrange gnuplot xrange<br />

gnuyrange gnuplot yrange<br />

gnusamples gnuplot samples<br />

gnuisosamples gnuplot gnuisosamples<br />

hidden3d gnuplot hidden3d<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.resetplot Reset the session<br />

Description<br />

Usage<br />

gp.resetplot resets the session<br />

gp.resetplot(h<strong>and</strong>le)


44 gp.RGB2image<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.RGB2image Work with RGB data<br />

Description<br />

Usage<br />

gp.RGB2image converts an RGB file to another image file gp.RGB1to3channels converts a vector<br />

or matrix of RGB 1-channel decimal values (24 bit) to 3-channel decimal values (3x8 bit)<br />

gp.RGB2DAT converts an RGB file to a matrix data file gp.RGBsample plots a squ<strong>are</strong> filled with<br />

an RGB color<br />

gp.RGB2image(RGBfile, imagefile, width, height, filetype=’PNG’, gpterminal=NULL)<br />

gp.RGB1to3channels(RGB1channel=NULL, fileRGB1channel=NULL, fileRGB3channel=NULL)<br />

gp.RGB2DAT(RGBfile, DATfile,width,height)<br />

gp.RGBsample(xRGB=’#FFFFFF’, optionalTitle=’’)<br />

Arguments<br />

RGBfile raw RGB file name<br />

imagefile image file name<br />

width image width<br />

height image height<br />

filetype image type<br />

gpterminal terminal name<br />

RGB1channel vector or matrix of RGB 1-channel decimal values (24 bit)<br />

fileRGB1channel<br />

file with RGB 1-channel decimal values (24 bit)<br />

fileRGB3channel<br />

file with RGB 3-channel decimal values (3x8 bit)


gp.run 45<br />

Value<br />

DATfile data file name<br />

xRGB RGB color in hexadecimal<br />

optionalTitle title for plot<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.image2image<br />

gp.run executes gnuplot code directly<br />

Description<br />

Usage<br />

gp.run returns the gnuplot version<br />

gp.run(cmd, optPause=FALSE)<br />

Arguments<br />

Value<br />

cmd String with gnuplot comm<strong>and</strong>s<br />

optPause boolean, TRUE means to pause after the execution<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.pause


46 gp.set.xlabel<br />

gp.set.term List or change gnuplot’s current terminal<br />

Description<br />

Usage<br />

gp.set.term sets gnuplot’s current terminal or get a list of all available terminals<br />

gp.set.term(optionalNewTerminal)<br />

Arguments<br />

Value<br />

optionalNewTerminal<br />

should be either empty or the name of an available terminal<br />

the name of gnuplot’s current terminal<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.showterm<br />

gp.set.xlabel Set the x-axis label<br />

Description<br />

Usage<br />

gp.set.xlabel sets the x-axis label<br />

gp.set.xlabel(h<strong>and</strong>le, label)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

label label for the x-axis<br />

none


gp.set.ylabel 47<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


48 gp.setfontpath<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.setloadpath 49<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


50 gp.setstyle<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.setvariable 51<br />

Examples<br />

#"Hello World!" - text on legend<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


52 gp.setwd<br />

gp.setwd Set gnuplot working directory<br />

Description<br />

Usage<br />

gp.setwd sets gnuplot working directory, default path = R’s working directory<br />

gp.setwd(h<strong>and</strong>le, wd)<br />

Arguments<br />

Value<br />

h<strong>and</strong>le h<strong>and</strong>le to the connection<br />

wd gnuplot working directory, default = R’s working directory<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.getwd<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.show.datafile.binary.filetypes 53<br />

gp.show.datafile.binary.filetypes<br />

List gnuplot’s RGB binary types<br />

Description<br />

Usage<br />

Value<br />

gp.show.datafile.binary.filetypes get gnuplot’s RGB binary types as a vector<br />

gp.show.datafile.binary.filetypes()<br />

vector with the names of gnuplot’s RGB binary types<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.image.plot<br />

gp.showterm Get gnuplot’s current terminal<br />

Description<br />

Usage<br />

Value<br />

gp.showterm gets gnuplot’s current terminal<br />

gp.showterm()<br />

the name of gnuplot’s current terminal<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.set.term


54 gp.SHP2gnu<br />

gp.SHP2gnu Work with shapefiles<br />

Description<br />

Usage<br />

gp.SHP2gnu given a shapefile (SHP) with full path <strong>and</strong> the shapefile layer name, the coordinates<br />

<strong>are</strong> saved to a text file readable by gnuplot<br />

gp.resampleDEM resamples DEM data, similarly to what GIS applications do<br />

gp.boxXY returns the box (coordinates) around a location, from a shapefile<br />

gp.map.PNG2lines draws "squarish" coastlines given a gridded map from a PNG image<br />

gp.matrix2PNG saves a matrix with a mask of a map to a PNG file<br />

gp.plot.map plots a map with vector <strong>and</strong> raster overlays<br />

gp.SHP2gnu(SHPfilename, SHPlayername,gnufilename,toCRS=’+init=epsg:4326’)<br />

gp.resampleDEM(fileIN, fileOUT, xrange, yrange, interpolationMethod, XYformat=FALSE)<br />

gp.boxXY(fileName)<br />

gp.map.PNG2lines(PNGfile, l<strong>and</strong>outlinefile)<br />

gp.matrix2PNG(matM,PNGfile)<br />

gp.plot.map(mapvectfiles=NA, projection=’PlateCarree’, linetype=’l’, linestyle=1, plotTitle=NA, mapr<br />

Arguments<br />

SHPfilename shapefile name<br />

SHPlayername shape layer name<br />

gnufilename output data file name<br />

toCRS optional CRS string to modify the projection<br />

fileIN input data file name<br />

fileOUT output data file name<br />

xrange x-axis range<br />

yrange y-axis range<br />

interpolationMethod<br />

dgrid3d interpolation method<br />

fileName shapefile name<br />

PNGfile PNG input file name<br />

l<strong>and</strong>outlinefile<br />

vector output file name<br />

matM matrix with map raster data<br />

XYformat boolean, TRUE=use XY format in input file<br />

mapvectfiles filenames with vector data


gp.splot 55<br />

Value<br />

projection cartographic projection<br />

linetype line type<br />

linestyle line style<br />

plotTitle title for the plot<br />

maprastfile filename of the raster file<br />

maprastpalette filename of the raster file’s palette<br />

AdditionalCode additional code to run before the plot<br />

projectionInit initialization values for the projection<br />

returnCode boolean, if TRUE the code is returned as a string<br />

none<br />

Author(s)<br />

See Also<br />

Pat Bartlein <strong>and</strong> Jose’ Gama<br />

gp.mapsr2gnu<br />

gp.splot Plots an expression in 3D with one function call<br />

Description<br />

Usage<br />

gp.splot plots an expression in 3D without the need to define h<strong>and</strong>les<br />

gp.splot(x, type = c(’hidden3d’, ’pm3d’, ’map’, ’contour’))<br />

Arguments<br />

Value<br />

x expression<br />

type type of 3D plot: hidden3d, pm3d, map or contour<br />

none<br />

Author(s)<br />

Oscar Perpi\~n\’an Lamigueiro


56 gp.URL2string<br />

See Also<br />

gp.init<br />

Examples<br />

## Not run: gp.splot(volcano)<br />

gp.splot(volcano, ’pm3d’)<br />

gp.splot(volcano, ’map’)<br />

gp.splot(volcano, ’contour’)<br />

## End(Not run)<br />

gp.URL2string Read a text file from the web to a string<br />

Description<br />

Usage<br />

gp.URL2string reads the contents of a text file from the web to a string<br />

gp.URL2string(mURL)<br />

Arguments<br />

Value<br />

mURL URL with the file to be read<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

#example of using gp.load.demo <strong>and</strong> gp.readURL2string<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.version 57<br />

if (!file.exists(’/usr/sh<strong>are</strong>/doc/gnuplot-doc/examples/simple.dem’)) stop(’Please install gnuplot-doc’)<br />

gp.load.demo(h1, ’/usr/sh<strong>are</strong>/doc/gnuplot-doc/examples/simple.dem’)<br />

#pause R <strong>and</strong> gnuplot<br />

gp.pause()<br />

# example of gp.readURL2string<br />

#Kuen’s Surface<br />

gpcode


58 gp.WindowStatus<br />

gp.WindowStatus Status of an X11 window<br />

Description<br />

Usage<br />

gp.WindowStatus returns the status of an X11 window<br />

gp.WindowStatus(windowid)<br />

Arguments<br />

Value<br />

windowid window id (X11)<br />

none<br />

Author(s)<br />

See Also<br />

Joel V<strong>and</strong>erWerf <strong>and</strong> Jose’ Gama<br />

gp.init<br />

Examples<br />

#Initialize the gnuplot h<strong>and</strong>le<br />

h1


gp.write.multi.csv 59<br />

gp.write.multi.csv Write multi column CSV file<br />

Description<br />

Usage<br />

gp.write.multi.csv Writes a multi column CSV file for use with gnuplot comm<strong>and</strong>s later<br />

gp.write.multi.csv(fileName,xListPtr,n,numColumns,title)<br />

Arguments<br />

Value<br />

fileName CSV file name<br />

xListPtr A list of pointers to column buffers<br />

n number of columns<br />

numColumns Length of xListPtr lis<br />

title Title to write for the first line of the .csv file, will be preceeded by "#"<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.write.x.csv Write single column CSV file<br />

Description<br />

Usage<br />

gp.write.x.csv writes a single column CSV file for use with gnuplot comm<strong>and</strong>s later<br />

gp.write.x.csv(fileName,x,n,title)


60 gp.write.xy.csv<br />

Arguments<br />

Value<br />

fileName CSV file name<br />

x A column buffer<br />

n number of columns<br />

title Title to write for the first line of the .csv file, will be preceeded by "#"<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

gp.write.xy.csv Write double column CSV file<br />

Description<br />

Usage<br />

gp.write.xy.csv writes a double column CSV file for use with gnuplot comm<strong>and</strong>s later<br />

gp.write.xy.csv(fileName,x,y,n,title)<br />

Arguments<br />

Value<br />

fileName CSV file name<br />

x A column buffer<br />

y A column buffer<br />

n number of columns<br />

title Title to write for the first line of the .csv file, will be preceeded by "#"<br />

none<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init


gp.X11.present 61<br />

gp.X11.present Check for X11 in the system<br />

Description<br />

Usage<br />

Value<br />

gp.X11.present returns TRUE if X11 is present in the system<br />

gp.X11.present()<br />

TRUE if X11 is present in the system<br />

Author(s)<br />

See Also<br />

Jose’ Gama<br />

gp.init<br />

Examples<br />

## Not run: gp.X11.present()<br />

sOp String concatenation operator<br />

Description<br />

Usage<br />

%s% concatenates 2 strings<br />

x %s% y<br />

Arguments<br />

Value<br />

x string<br />

y another string<br />

none


62 sOp<br />

Author(s)<br />

Jose’ Gama<br />

Examples<br />

# create two strings<br />

## Not run:<br />

t1


Index<br />

∗Topic programming<br />

gp.CheckH<strong>and</strong>le, 3<br />

gp.close, 4<br />

gp.cmd, 5<br />

gp.colorhistogram, 6<br />

gp.cols2rows, 7<br />

gp.diverging.colormap, 8<br />

gp.errmsg, 9<br />

gp.ext2terminal, 10<br />

gp.file2string, 10<br />

gp.fit.allprogress, 11<br />

gp.fit.progress, 12<br />

gp.getfontpath, 13<br />

gp.getloadpath, 14<br />

gp.getvariable, 15<br />

gp.getwd, 16<br />

gp.h, 17<br />

gp.hexRGB, 18<br />

gp.image.crop, 18<br />

gp.image.rgbchange, 20<br />

gp.init, 21<br />

gp.init.save.stderr, 22<br />

gp.isWindowOpen, 23<br />

gp.killpidX11, 23<br />

gp.load.demo, 24<br />

gp.m<strong>and</strong>el, 25<br />

gp.map.merpar, 26<br />

gp.math3d.plot, 27<br />

gp.matrix2GimpPalette, 28<br />

gp.matrix2XYdata, 29<br />

gp.matrixfile.pad, 30<br />

gp.matrixr2gnu, 31<br />

gp.pausableterm, 32<br />

gp.pause, 32<br />

gp.pauseX, 33<br />

gp.pidX11, 34<br />

gp.plot.equation, 34<br />

gp.plot.once, 35<br />

gp.plot.slope, 36<br />

63<br />

gp.plot.x, 37<br />

gp.plot.xy, 38<br />

gp.plotFunction, 38<br />

gp.plotPolyFit, 39<br />

gp.PNG2color, 40<br />

gp.PNG2RGB, 41<br />

gp.PNG4DEM, 41<br />

gp.R2plot, 42<br />

gp.R2splot, 43<br />

gp.resetplot, 43<br />

gp.RGB2image, 44<br />

gp.run, 45<br />

gp.set.term, 46<br />

gp.set.xlabel, 46<br />

gp.set.ylabel, 47<br />

gp.setfontpath, 48<br />

gp.setloadpath, 49<br />

gp.setstyle, 50<br />

gp.setvariable, 51<br />

gp.setwd, 52<br />

gp.show.datafile.binary.filetypes,<br />

53<br />

gp.showterm, 53<br />

gp.SHP2gnu, 54<br />

gp.splot, 55<br />

gp.URL2string, 56<br />

gp.version, 57<br />

gp.WindowStatus, 58<br />

gp.write.multi.csv, 59<br />

gp.write.x.csv, 59<br />

gp.write.xy.csv, 60<br />

gp.X11.present, 61<br />

sOp, 61<br />

%s% (sOp), 61<br />

gp.boxXY (gp.SHP2gnu), 54<br />

gp.CheckH<strong>and</strong>le, 3<br />

gp.close, 4, 5, 21<br />

gp.cmd, 5, 21<br />

gp.colorhistogram, 6, 27


64 INDEX<br />

gp.cols2rows, 7<br />

gp.CreateIndexFromMatrixAndPalette<br />

(gp.matrix2GimpPalette), 28<br />

gp.CreatePaletteFromMatrix<br />

(gp.matrix2GimpPalette), 28<br />

gp.diverging.colormap, 8<br />

gp.errmsg, 9<br />

gp.ext2terminal, 10<br />

gp.file2string, 10<br />

gp.fit.allprogress, 11<br />

gp.fit.progress, 12<br />

gp.getfontpath, 13<br />

gp.getloadpath, 14<br />

gp.getvariable, 15<br />

gp.getwd, 16, 52<br />

gp.GimpPalette2matrix<br />

(gp.matrix2GimpPalette), 28<br />

gp.h, 17<br />

gp.hexRGB, 18<br />

gp.image.crop, 18<br />

gp.image.decimate (gp.image.crop), 18<br />

gp.image.flip (gp.image.crop), 18<br />

gp.image.plot, 21, 53<br />

gp.image.plot (gp.image.crop), 18<br />

gp.image.resize (gp.image.crop), 18<br />

gp.image.rgbchange, 18, 20, 20<br />

gp.image.rgbfalsecolor<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbfiltercolor.blue<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbfiltercolor.green<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbfiltercolor.red<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbfiltercolor.sepia<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbfiltercolor.sepia2<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbgreyscaleavg<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbgreyscaleBT709<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbgreyscaleLinear<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbgreyscaleLuminosity<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbgreyscaleRMY<br />

(gp.image.rgbchange), 20<br />

gp.image.rgbgreyscaleY<br />

(gp.image.rgbchange), 20<br />

gp.image.rotate (gp.image.crop), 18<br />

gp.image.tile (gp.image.crop), 18<br />

gp.image2image, 45<br />

gp.image2image (gp.image.crop), 18<br />

gp.image2PNG (gp.image.crop), 18<br />

gp.init, 4, 5, 7, 9, 11–13, 17, 21, 22–25, 29,<br />

31, 33–44, 47–51, 56–61<br />

gp.init.save.stderr, 22<br />

gp.isWindowOpen, 23<br />

gp.killpidX11, 23<br />

gp.load.demo, 24<br />

gp.m<strong>and</strong>el, 25<br />

gp.map.merpar, 26<br />

gp.map.PNG2lines (gp.SHP2gnu), 54<br />

gp.mapsr2gnu, 55<br />

gp.mapsr2gnu (gp.map.merpar), 26<br />

gp.math3d.plot, 27<br />

gp.matrix2GimpPalette, 28, 30<br />

gp.matrix2palette<br />

(gp.matrix2GimpPalette), 28<br />

gp.matrix2PNG (gp.SHP2gnu), 54<br />

gp.matrix2XYdata, 29<br />

gp.matrixfile.pad, 30<br />

gp.matrixr2gnu, 31<br />

gp.palette.plot<br />

(gp.matrix2GimpPalette), 28<br />

gp.pausableterm, 32<br />

gp.pause, 32, 32, 45<br />

gp.pauseX, 33<br />

gp.pidX11, 34<br />

gp.plot.equation, 34<br />

gp.plot.map (gp.SHP2gnu), 54<br />

gp.plot.once, 35<br />

gp.plot.slope, 36<br />

gp.plot.x, 37<br />

gp.plot.xy, 38<br />

gp.plotFunction, 38<br />

gp.plotPolyFit, 39<br />

gp.PNG2color, 40<br />

gp.PNG2RGB, 41<br />

gp.PNG4DEM, 41<br />

gp.R2plot, 42<br />

gp.R2splot, 43<br />

gp.resampleDEM, 27, 29<br />

gp.resampleDEM (gp.SHP2gnu), 54<br />

gp.resetplot, 43


INDEX 65<br />

gp.RGB1to3channels (gp.RGB2image), 44<br />

gp.RGB2DAT (gp.RGB2image), 44<br />

gp.RGB2image, 44<br />

gp.RGBsample (gp.RGB2image), 44<br />

gp.run, 8, 45<br />

gp.saveXYfile (gp.matrixfile.pad), 30<br />

gp.set.term, 10, 46, 53<br />

gp.set.xlabel, 46<br />

gp.set.ylabel, 47<br />

gp.setfontpath, 48<br />

gp.setloadpath, 14, 49<br />

gp.setstyle, 50<br />

gp.setvariable, 15, 51<br />

gp.setwd, 16, 52<br />

gp.show.datafile.binary.filetypes, 53<br />

gp.show.palette.colornames<br />

(gp.matrix2GimpPalette), 28<br />

gp.showterm, 46, 53<br />

gp.SHP2gnu, 54<br />

gp.splot, 55<br />

gp.URL2string, 56<br />

gp.version, 57<br />

gp.WindowStatus, 58<br />

gp.write.multi.csv, 59<br />

gp.write.x.csv, 59<br />

gp.write.xy.csv, 60<br />

gp.X11.present, 61<br />

gp.XYcoords.convert.fun<br />

(gp.matrixfile.pad), 30<br />

gp.XYcoords2shpere (gp.matrixfile.pad),<br />

30<br />

gp.xydata2matrix (gp.matrixfile.pad), 30<br />

sOp, 61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!