geotheory
geotheory

Reputation: 23650

R skewed colours when drawing TIFF image

I'm trying to plot a GeoTIFF I made in ArcGIS as the background canvas to some maps, but I've hit a wall getting the colours right.

The ArcGIS output:

ArcGIS output

But the same GeoTIFF - read into R with readGDAL() {rgdal} and drawn with image() - produces this:

Drawn in R with image()

I've tried playing around with colour options - e.g. the colour schemes (rainbow, heat.colors, topo.colors, terrain.colors) are severely limited, and grey() produces a uniform grey box of customisable tone!

Most grateful for any advice on how to plot the GeoTIFF's true colours, or alternatively something not too garish.

(The functions I used are literally the forms I've given - no additional arguments or settings)

thanks in advance

Robin

Upvotes: 0

Views: 365

Answers (1)

Spacedman
Spacedman

Reputation: 94182

Try reading it with the raster package into a 'stack' (it should have three bands), then using plotRGB from the raster package.

require(raster)
map = stack("mymap.tif")
plotRGB(map)

Upvotes: 3

Related Questions