Skip to contents

An eye-candy utility function for 3d-effect of global maps

Usage

sphereshade(
  n = 180,
  left = "#ffffff",
  right = "#aaaaaa",
  crs = "EPSG:4326",
  left.alpha = 1,
  right.alpha = 1,
  west = -180,
  east = 180
)

Arguments

n

The number of color bands.

left

RGB color for the left side of the gradient.

right

RGB color for the right side of the gradient.

crs

A coordinate reference system string to be passed to mapedge.

left.alpha

The alpha value (0-1) used for the left side of the plot.

right.alpha

The alpha value (0-1) used for the right side of the plot.

west

The xmin argument of mapedge.

east

The xmax argument of mapedge.

Details

The function plots a gradient on a geographic projection, either as a color or as an alpha gradient, the function relies on mapedge for the calculation of bands.

Examples

# basic use
me <- mapedge()
plot(me)
sphereshade()


# In Robinson projection
me <- mapedge(crs="ESRI:54030")
plot(me)
sphereshade(left="#0f3f67", right="#1A6BB0", crs="ESRI:54030")