panel_graticule | R Documentation |
panel_graticule
puts a grid on the panel with raster image. If CRS is georeferenced then grid is generated from longitudes and latitudes.
panel_graticule(...)
compose_graticule(...)
# non-public
.compose_graticule(panel = 0L, col = "grey70", border = "grey70", lon = NA, lat = NA,
lwd = 0.5, lty = 2, marginalia = rep(FALSE, 4), trim = FALSE,
language = NA_character_, cex = 0.75, verbose = FALSE)
# non-public
.panel_graticule(obj, marginalia = rep(TRUE, 4), verbose = FALSE)
... |
Set of arguments, which are recognized via their names (using regular expressions) and classes:
| |||||||||||||||||||||||||||||||||||||||
obj |
Objects of the class | |||||||||||||||||||||||||||||||||||||||
panel |
Integer vector. Panel for which coastline will be displayed. | |||||||||||||||||||||||||||||||||||||||
col |
Character. Color code/name for grid lines. Default is | |||||||||||||||||||||||||||||||||||||||
border |
Character. Color code/name for marginal labels and ticks. Default is | |||||||||||||||||||||||||||||||||||||||
lon |
Numeric vector. Set of longitudes for grid. If | |||||||||||||||||||||||||||||||||||||||
lat |
Numeric vector. Set of latitudes for grid. If | |||||||||||||||||||||||||||||||||||||||
lwd |
Positive numeric. Width of grid line. Default is | |||||||||||||||||||||||||||||||||||||||
lty |
Positive integer. Type (pattern) of grid line. Default is | |||||||||||||||||||||||||||||||||||||||
marginalia |
Logical or integer vectors. Responsible for whether longitudes and latitudes (or metric coordinates) be labelled on the frame of panel with raster image. If logical and | |||||||||||||||||||||||||||||||||||||||
language |
Character. Language for longitude and latitude captions. If | |||||||||||||||||||||||||||||||||||||||
trim |
Logical. If grid lines are labelled then | |||||||||||||||||||||||||||||||||||||||
cex |
Positive numeric. The relative font size for grid lines' labels. Make sence in the case of labels plotting. Default is | |||||||||||||||||||||||||||||||||||||||
verbose |
Logical. Value |
If not language="ru"
but environmental variable LANGUAGE=ru
then labels are in Russian (cyrillics).
Argument gridline
(or, grid
) is introduced for unconditional calling of panel_graticule
inside of high-level functions.
Grid lines can be controlled in high-level plot functions (e.g., display
, compose_plot
, display_stack
, display_brick
, display_rgb
, etc.). To prevent displaying grid lines, use argument gridline=FALSE
(or grid=FALSE
). To display grid lines, use argument gridline=TRUE
(or grid=TRUE
) and prefix grid(line)*
(gridline.*
or grid.*
) for grid lines' parameters, e.g., gridline.verb=TRUE
, grid.col="black"
. If prefix is omitted then arguments with the same names affect in other functions in the part of high-level function.
If grid lines are formed internally, then desirable number of lines for each direction is 3. The design of line density is based on intuition, providing pretty labelling.
If CRS is georeferenced then grid lines are corresponded to longitudes and latitudes. Integer minutes are used to illustate fractional values of degrees. If precision of minutes is insufficient, then integer values of seconds are introduced. The fractional values of seconds are not used.
Labels are located at the points, where grid lines cross plot margin. Labels are not overlapped along the same side. To prevent overlapping along the same side, labels are shifted or omitted. Argument trim=TRUE
prevents overlapping labels from neighbor sides via hidding.
Function returns NULL
value.
Nikita Platonov platonov@sevin.ru
session_grid(NULL)
## Changing of environmental variables is out of CRAN Policy
## Not run: Sys.setenv(LANGUAGE="ru")
# example no.1
cl <- compose_design(layout=c(2,2),legend=NULL)
session_grid(regrid(lim=3.2*1e6*c(-1,-1,1,1)))
compose_open(cl)
for (i in 1:4) {
panel_new()
panel_coastline()
panel_graticule(decor=TRUE,trim=i %in% c(2:4))
panel_annotation(text=as.character(i))
panel_scalebar(scalebar=i==3)
}
compose_close()
# example no.2
session_grid(regrid(lim=1e6*c(-0.5,0.5,1.5,2.5)))
compose_open(layout=c(2,2),legend=NULL,skip=4)
for (i in seq(getOption("ursaPngLayout")$image)) {
panel_new()
panel_coastline()
if (i==1)
panel_graticule()
else if (i==2)
panel_graticule(decor=TRUE,lon=seq(0,360,by=40)[-1],lat=seq(-90,90,by=10))
else if (i==3)
panel_graticule(decor=TRUE,lon=seq(0,360,by=20)[-1],lat=seq(-90,90,by=5)
,trim=TRUE)
else if (i==4)
panel_graticule(gridline=FALSE)
panel_scalebar(scalebar=1)
panel_annotation(text=as.character(i))
}
compose_close()
# example no.3 -- indirect usage
session_grid(NULL)
display(pixelsize(),decor=TRUE,grid.col="green3",coast.col="darkgreen",side=2)
## Changing of environmental variables is out of CRAN Policy
## Not run: Sys.setenv(LANGUAGE="") # reset environmental variable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.