<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Tom,</p>
<p>Try something like that:</p>
<p><tt>spplot(raster, at=1:3, <br>
col.regions=c(col1, col2, col3), <br>
colorkey=list(labels=list(labels=c("Af", "Am", "Aw"),
at=1:3+.5)))</tt></p>
<p>Else use package `tmap` (friendlier interface).<br>
</p>
<p>--Mel.<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 8/10/20 10:05 PM, Thomas Adams
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGxgkWjPvLh2ZznxbYs916P7iY364KeNBQPo7v99BZz=JGTZkg@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">Hi Tim,
Yes, basically, I have and just did again, try this -- same result...
Tom
On Mon, Aug 10, 2020 at 4:34 PM Tim Salabim <a class="moz-txt-link-rfc2396E" href="mailto:tim.appelhans@gmail.com"><tim.appelhans@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Have you tried
colorkey=list(labels = list(labels = list("Af","Am","Aw")))
?
On Mon, Aug 10, 2020, 22:01 Thomas Adams <a class="moz-txt-link-rfc2396E" href="mailto:tea3rd@gmail.com"><tea3rd@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Hi all,
I have searched for examples to change the labeling for raster data (two
panels) consisting of integer values (1, 2, and 3). In the scale I want to
label these as "Af", "Am", Aw".
My code looks like:
colp <- colorRampPalette(c("#960000", "#FF0000", "#FFCCCC"))
brks<-seq(0,3,1)
spplot(KG_haiti,xlim=c(-8313027,-7959668),ylim=c(2017552,2297053),at=brks,col.regions=colp(length(brks)-1),ylab="Climate
Class",main="Koppen-Geiger Climate Classification for\nClimate Years
1981-2010 and El Nino Years",names.attr=c("Climate Normal","El
Nino"),colorkey=list(labels = list(labels = c("Af","Am","Aw"))))
I'm getting just the 3 colors, but the labels "Af", "Am", Aw" are repeated
across each color; I need to have each color associated with just one of
the labels. Obviously, I'm doing something wrong...
I just cannot figure out how to do this.
Regards,
Tom
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-sig-Geo@r-project.org">R-sig-Geo@r-project.org</a>
<a class="moz-txt-link-freetext" href="https://stat.ethz.ch/mailman/listinfo/r-sig-geo">https://stat.ethz.ch/mailman/listinfo/r-sig-geo</a>
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
</html>