[Thread Prev][Thread Next][Index]

Re: [ferret_users] aspect ratio



Hi David -

Do this using DEF VI/AXES.

Suppose I want 4 windows that are 40 degrees (longitude) wide and 30 degrees (latitude) high in a 2by2 viewport window. Thinking of everything in degrees, I want 5 degrees space on the bottom, 4 degrees space between them vertically, and 8 degrees on top for the label. I want 6 degrees on the left, 5 degrees in the middle horizontally, and 7 degrees on the right for the colorbar.

! the viewport width/height (degrees)
let wide=40;let ht=30
! spacing in the vertical direction. totht is the entire plot height (degrees).
let bot=5; let vmid=4; let top=8; let totht=`bot+vmid+top+2*ht`
! spacing in the horizontal direction. totwidth is the entire plot width (degrees)
let left=6; let hmid=5; let right=7; let totwidth=`left+hmid+right +2*wide`
! use these values to set the window aspect ratio
set win/asp = `totht/totwidth`
! define the viewports using the above values
def vi/axes/xli=`left/totwidth`,`(left+wide)/totwidth`/yli=`bot/ totht`,`(bot+ht)/totht` botleft
def vi/axes/xli=`left/totwidth`,`(left+wide)/totwidth`/yli=`(bot+vmid +ht)/totht`,`(bot+vmid+2*ht)/totht` topleft
def vi/axes/xli=`(left+wide+hmid)/totwidth`,`(left+hmid+2*wide)/ totwidth`/yli=`bot/totht`,`(bot+ht)/totht` botright
def vi/axes/xli=`(left+wide+hmid)/totwidth`,`(left+hmid+2*wide)/ totwidth`/yli=`(bot+vmid+ht)/totht`,`(bot+vmid+2*ht)/totht` topright

In general the idea is to think of everything in user units when trying to make a plot with the correct aspect ratio (as for vectors on a map).

Billy K

On Jan 21, 2006, at 9:13 AM, David Wang wrote:

Hello Ferreters,

how can i get the aspect ratio (geometric or geographic) of each
plotting region (not viewpoint itself) in a multi-viewpoint window? my
purpose is to adjust the direction of velocity vectors propotional to
the scaling of plotting area. any thoughts?

thanks very much,
- d.

--
Daiwei (David) WANG    Graduate Student
Dept. of Earth and Environmental Sciences and
Lamont-Doherty Earth Observatory
Columbia University
Email: dwang<AT>ldeo.columbia.edu









[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement