GME

Geospatial Modelling Environment

r.graphsettings (Graph Settings)

Changes the default graph parameters that are used to generate graphics in R

Description

This command allows you to change the default graph parameters that are used to generate graphics in R. Some of the parameters only affect the next graphics to be produced, while the other parameters affect all subsequent graphics.

The parameters 'xlab', 'ylab' and 'main' correspond to the x axis title, the y axis title and the main title respectively, and only affect the next graph to be produced, after which they are reset. You must therefore set these for each graph if you wish to customize the labels or title. Unlike R, you should not use quotation marks to set these parameters (see the example below). Note that for the labels, the code will automatically wrap long labels ( > 50 characters) onto multiple lines.

The 'width' and 'height' parameters refer to the dimensions in pixels of the graphic that is produced. The default is 500 x 500 pixels. Small dimensions ( < 300 pixels) may result in absurd graphics.

The 'pointsize' parameters refers to the size of text. Note that the size of the main title text is always automatically scaled to be larger than the text of the axis labels. Point sizes in the range of 9-16 are likely to produce reasonable graphics.

The 'fillcol' parameters sets the default fill colour (e.g. for bars in a histogram), and 'linecol' sets the default line colour for graph types that display lines. Colours are specified using colour names. See the R Colours appendix for samples of colours and their names.

The 'filetype' parameters controls the output file type. The default is Ping (png), which is a widely used format that most other software you encounter will be able to use. You may change the default to JPEG format (jpg) or Windows Bitmap format (bmp).

This command is driven by R. Type 'citation' to see the suggested citation for R.

Syntax

r.graphsettings([xlab], [ylab], [main], [width], [height], [pointsize], [fillcol], [linecol], [filetype]);

[xlab]the x axis label for the next plot (overrides the default label)
[ylab]the y axis label for the next plot (overrides the default label)
[main]the main title for the next plot (overrides the default title, which is usually no title)
[width]the width of the output plot in pixels (default=700)
[height]the height of the output plot in pixels (default=700)
[pointsize]the font size for text on R graphics (default=12)
[fillcol]the fill colour for plots like histograms (default=lightgreen) - see the full help documentation for a list of R colours
[linecol]the line colour for plots (default=lightgreen) - see the full help documentation for a list of R colours
[filetype]the output file type for R graphics (default=png; options: png, jpg, bmp)

Example

r.graphsettings(xlab="X Coordinate (UTM)", ylab="Y Coordinate (UTM)", main="Animal locations", width=900, height=900);

r.graphsettings(width=400, height=400, filetype="jpg", pointsize=9, fillcol="blue");


Messages

Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently  Read more...

Links

Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn