[R-sig-Geo] filled.contour and legend height control

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Tue Jul 7 14:28:49 CEST 2009


Paul Hiemstra a écrit :
> Patrick Giraudoux wrote:
>> Hello,
>>
>> Filled contour is a really nice function, except when one use the 
>> argument asp=1. In this case the legend height can be too large 
>> compared to the image plot height.
>>
>> Is there a way to control the legend height in filled.contour (eg 
>> fixing somewhere a ylim=c(min value, max value) to make it the same 
>> height as the image in the big plot) ?
>>
>> Best,
>>
>> Patrick
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> Hi,
>
> Could you provide use with a piece of code that reproduces your 
> problem. That would make it much easier to help you.
>
> cheers,
> Paul
>

Yes indeed. Here we are:

# example without asp

x<-seq(1,10,l=20)
y<-seq(1,5,l=20)
z<-rnorm(400)
zmat<-matrix(z,ncol=20)
filled.contour(x,y,zmat,frame.plot = FALSE)

# example with asp (eg: a geographic map projected where x and y display 
ratio must be 1

x<-seq(1,10,l=20)
y<-seq(1,5,l=20)
z<-rnorm(400)
zmat<-matrix(z,ncol=20)
filled.contour(x,y,zmat,frame.plot = FALSE,asp=1)

I wonder if there is a way to resize the legend in such a way it as the 
same height as the image displayed...

Best,

Patrick



More information about the R-sig-Geo mailing list