Florence--
I might misunderstand your question, but I think that your problem is the
type in your SpatialPixelsDataFrame, not your call to plotKML.  From what
you describe, I assume that the values in your SpatialPixelsDataFrame are
numeric.  If you want a specific color legend, you need to use a factor
instead of a numeric.

If your values in the SpatialPixelsDataFrame take exactly
{2,4,10,30,60,100}, you may need to convert the values from numeric to a
factor with factor().  If your values are numeric but take any value (e.g.,
from 0 to 100), you may want to convert it to a factor using cut() with
c(0,2,4,10,30,60,100).

I hope that this helps and points you in the right direction.
Tom


On Tue, Aug 6, 2013 at 8:48 AM, TROUDE Florence
<FTroude@air-rhonealpes.fr>wrote:

> Dear list,
>
> I use the plotKML library to plot maps of simulation results (pollen maps).
> It's quite great but I'd like to have some colors at some defined levels
> such as :
> 2 -> white
> 4 -> green
> 10 -> yellow
> 30 -> orange
> 60 -> red
> 100 -> black
>
> my object is a SpatialPixelsdataframe or a SpatialGriddataframe.
>
> When I use plotKML with for instance data range from 0 to 10, I don't
> menage to coerce the levels/colors of the map :
> the color_scale always fit to the min/max of the data and don't fellow the
> levels (2,4,10,30,60,100)...
> I have tried colour_scale, colour, levels options but it doesn't work.
>
> Does anyone have encountered the same problem and fixed it ?
>
> Regards,
>
> Florence
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

