[R-sig-Geo] Tweak legend in image.plot()

Paul Hiemstra p.hiemstra at geo.uu.nl
Mon Jan 11 14:00:56 CET 2010


Muhammad Rahiz wrote:
> Hi all,
>
> I've plotted my data using;
> > image.plot(data, zlim=c(0,800), add=FALSE, nlevel=100, horizontal=T, 
> legend.shrink=0.5, legend.width=.8, col=tim.colors(100))
>
> From here, I'd like to make adjustments to the legend like;
>
> 1. Reversing the scale.
> For example, the legend plots zlim as 0= blue to 800=red. Since I'm 
> dealing with rainfall data, it's more visually logical to express 
> highest precipitation as blue. Hence 0 = red to 800 = blue would be 
> desired.
try: col = rev(tim.colors(100))

In addition, consider using the spatial classes provided by the 
sp-package to plot your data. See [1] for some examples of spatial plot.

cheers,
Paul

[1] 
http://wiki.r-project.org/rwiki/doku.php?id=tips:spatial-data:spatial_data_visualization
>
> 2. Shifting the legend up by 2inches from the bottom of the page
>
> 3. Changing the legend's font size/type.
>
> Does anyone have any suggestions?
>
>
>
> Muhammad
>


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul



More information about the R-sig-Geo mailing list