[R-sig-Geo] Changing colour gradient in Spatstat surface plot
Mulholland, Tom
Tom.Mulholland at dpi.wa.gov.au
Thu May 1 04:14:09 CEST 2008
# Rogers suggestion was
library(RColorBrewer)
bl5 <- brewer.pal(5, "Blues")
mypal <- colorRampPalette(bl5)
# but he was saying any method of getting a list of colours is OK
rev(mypal(256))
rainbow(256)
colorRampPalette(c("lightblue","navy"))(256)
# then your example
library(spatstat)
data(longleaf)
Z <- smooth.ppp(longleaf)
par(mfrow = c(2,2))
plot(Z)
plot(Z, col=rev(mypal(256)))
plot(Z, col = colorRampPalette(c("lightblue","navy"))(256))
plot(Z, col = rainbow(256))
When Roger noted they were hard-coded he meant that the function
topo.colors and others are standard. Adrian was just pointing out that
his function is not hard coded to those functions and that you can use
any other function.
Tom
-----Original Message-----
From: r-sig-geo-bounces at stat.math.ethz.ch
[mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Graham Smith
Sent: Wednesday, 30 April 2008 3:00 AM
To: r-sig-geo at stat.math.ethz.ch
Subject: Re: [R-sig-Geo] Changing colour gradient in Spatstat surface
plot
Adrian
Thanks for the reply
> Here is an example of the whole process, starting from a marked point
> pattern and finishing with a colour image:
>
> library(spatstat)
> data(longleaf)
> Z <- smooth.ppp(longleaf)
> plot(Z)
> plot(Z, col=topo.colors(256))
This is what I did, but I couldn't find, and still can't find,
anything in the help for plot.im or topo,colors that explains how to
change the colours to graduated blue, am being really dim here.
However, in another post it was suggested I use rColorbrewer to set up
the colours , but it worries me that I cannot find the bit in the help
you have sent me to.
Graham
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list