[Thread Prev][Thread Next][Index]

Re: polar stuff




Alice,
I was able to reproduce the error you see with a different data set, when I
left off the "set grid" command.  Perhaps grid t_ave or diff is not defined 
the way you intended.  In your example, try

yes? load diff
yes? show grid 
yes? show variable diff

-- what do you see?


Ansley Manke

-----------------------
(your message)

Date: Fri, 18 Jun 1999 16:02:50 +0100 (BST)
From: a.larkin@ic.ac.uk
Subject: polar stuff


Hello, I am using the mp_projection scripts to make nice polar plots, and
after using go mp_stereographic_north successfully I began to use the 
mp_stereographic_south. I thought that all I'd have to change would be the 
region from y=10:90 to y=-10:-90. But although my routine begins to produce
the plot, during ppl fill it fails with the message
**ERROR: illegal limits: "MASKED_X_PAGE" is not in the range Y=-90:-10
Axis extremes are Y=0.5;10000000
plot/set/vs/nolab/line=1/i=1:22585/overlay masked_x_page, masked_y_page
Command file, command group, or REPEAT execution aborted.
my script is as follows...

set viewport 1
set region/x=0:360/y=-10:-90/z=500
set grid t_ave
go mp_stereographic_south
go margins 0.8,2.8,0.2,0.8
fill/noaxis/levels=(-0.6,1.3,0.1)/set_up diff[z=500,l=1:12@ave], x_page, y_page
ppl labs 4,0,0@as;ppl labs 5,0,0@as;ppl title "500 mbar"
go remove_logo
ppl fill
go mp_land
go mp_graticule 0 360 30 -10 -90 15
Please help 
Thanks
Alice






----- End Included Message -----

----------
X-Sun-Data-Type: text
X-Sun-Encoding-Info: 7BIT
Content-disposition: inline; filename=mp_viewport_aspect.jnl
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 103

\cancel mode verify	
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
! mp_viewport_aspect.jnl -- Calculate the appropriate aspect ratio for the
!                           current region and map projection and then define
!                           a viewport with the appropriate dimensions.
!		    		
! Jonathan Callahan
! 6/99

! Description:  Define a viewport for plotting map projections
!
! Usage:           arg1   arg2   arg3     arg4         arg5
!  go mp_viewport xlolim xhilim ylolim text_factor [viewport_name]
!
! arg 1 - X lo limit [0,1] (as in DEFINE VIEWPORT/XLIMITS=xlolim,xhilim)
! arg 2 - X hi limit [0,1] (as in DEFINE VIEWPORT/XLIMITS=xlolim,xhilim)
! arg 3 - Y lo limit [0,1] (as in DEFINE VIEWPORT/YLIMITS=ylolim,yhilim)
! arg 4 - text prominence  (as in DEFINE VIEWPORT/TEXT=text_factor)
! arg 5 - viewport name

! Example 1: 2 viewports on an 8.5 X 11 plot
!
!  set win/size=.4/aspect=`11/8.5` ! set up desired page size and aspect
!  use coads_climatology
!  set grid sst                    ! out of habit, for map projections
!  shade sst[l=1]                  ! to initialize the window
!  set region/x=80w:40e/y=30n:80n
!  go mp_bonne
!  go margins 0.4 0.4 0.4 0.8      ! to specify narrow margins
!  go mp_viewport_aspect 0 1 0 1 mp_vp1
!  shade/noaxis/nolabel sst[l=7], x_page, y_page
!  go mp_fland
!  go mp_label 340 85 0 0 .3 "@TRJuly SST"
!  go mp_viewport_aspect 0 1 0.5 1 mp_vp2
!  shade/noaxis/nolabel sst[l=1], x_page, y_page
!  go mp_fland
!  go mp_label 340 85 0 0 .3 "@TRJanuary SST"
!

! Getting the right aspect ratio for plots in viewports is rather
! complicated because of the interaction of various elements in 
! plot plus.  In order to get the aspect ratios right, we need to
! calculate and specify the X and Y axis lengths.
!
! The basic equations we need to know are the following:
!
! xaxlen = xfraction * plot_width - right_margin - left_margin
! yaxlen = yfraction * plot_height - top_margin - bottom_margin
! aspect_ratio = yaxlen / xaxlen
!
! For non-viewports xfraction and yfraction are both 1.0.
!
! When using viewports, 
!
! xfraction = scale * (xhilim - xlolim)
! yfraction = scale * (yhilim - ylolim)
! scale = 1 / sqrt(text_factor)
!
! If you know xhilim, xlolim, ylolim, text_factor and the
! various margins, you can solve for yhilim which is what we do
! below.


! First determine the margins that are currently set
!
let/quiet mp_vp_top = `($vp_height) - ($ppl$yorg) - ($ppl$ylen)`
let/quiet mp_vp_bottom = `($ppl$yorg)`
let/quiet mp_vp_left = `($ppl$xorg)`
let/quiet mp_vp_right = `($vp_width) - ($ppl$xorg) - ($ppl$xlen)`

! Get the arguments 
!
let/quiet mp_vp_xlolim=$1"0"
let/quiet mp_vp_xhilim=$2"1"
let/quiet mp_vp_ylolim=$3"0"
let/quiet mp_vp_text_factor = $4"1"
let/quiet mp_vp_fractional_width = mp_vp_xhilim-mp_vp_xlolim

! Calculate the aspect ratio
!
let/quiet mp_vp_x_axis_range = `x_page[i=@max,j=@max]` - `x_page[i=@min,j=@min]`
let/quiet mp_vp_y_axis_range = `y_page[i=@max,j=@max]` - `y_page[i=@min,j=@min]`
let/quiet mp_vp_ratio = mp_vp_y_axis_range / mp_vp_x_axis_range

let mp_vp_xfrac = mp_vp_fractional_width / mp_vp_text_factor^0.5

let mp_vp_fractional_height = (mp_vp_text_factor^0.5/($ppl$height)) * (mp_vp_ratio*(mp_vp_xfrac*($ppl$width)-mp_vp_left-mp_vp_right)+mp_vp_top+mp_vp_bottom)

! Define the new viwport
! Set the new viewport
! Keep the original margin specification
!
define view/xlimits=`mp_vp_xlolim`,`mp_vp_xhilim`/ylimits=`mp_vp_ylolim`,`mp_vp_ylolim+mp_vp_fractional_height`/text=`mp_vp_text_factor` $5"mp_viewport"
set view $5"mp_vewport"
go margins `mp_vp_top` `mp_vp_bottom` `mp_vp_left` `mp_vp_right`

! Clean up our mess
!
cancel variable mp_vp_*

!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
set mode/last verify
 


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement