[Thread Prev][Thread Next][Index]

Re: shakey in hammer projection



Hi everyone,
There is already an FAQ covering much of this topic,

How can I get the right aspect ratio for map projections in viewports?
http://www.ferret.noaa.gov/Ferret/FAQ/graphics/mp_viewport_aspect.html



Ansley Manke wrote:

Hi Boyin,
This involves the interaction of the map projection and the size of
the viewport. If you call mp_aspect this sets the aspect ratio of the
entire window. If you also define a viewport, the dimensions that you
give to the viewport also sets the ratio of the horizontal and vertical axes.
The viewport is more flattened than the aspect ratio that mp_aspect
computes.

Then when you make a shade or fill plot, with Ferret determining the size
of the shade key automatically, the key can seem to disappear in a small
and flattened viewport. See what the mp_aspect.jnl script is doing with
yes? go/help mp_aspect

You should probably set your data and the region, call mp_hammer, set the
grid, then do

yes? go mp_aspect LIST

The script computes the appropriate aspect ratio for the projection and
the region. Use the result to define the viewport. Define the viewport
with the /AXES qualifier to accurately set the correct ratio of the
axis lengths. Here is an example. I think I will make this into an
FAQ as it's an interesting detail that should be documented.

yes? can mode logo

! Start with a window having a known aspect ratio of 1.

yes? set win/asp=1

yes? can mode logo
yes? use coads_climatology
yes? go mp_hammer
yes? set grid sst

! Set the variable y_over_x to use in
! setting the viewport.

yes? go mp_aspect LIST

! Define the relative lengths of the axes,
! as a proportion of the entire window.
! Because we started with an overall aspect
! ratio of 1, the viewport axis ratio will
! be set by y_over_x

! The numbers 0.1, 0.45 and 0.65 are arbitrary,
! setting the desired location of the viewport.

yes? let xlen = 0.45-0.1
yes? let ylen = xlen*y_over_x
yes? define view/axes/xlim=0.1,0.45/ylim=0.65,`0.65+ylen` v1

! Shade with automatic shade key

yes? set view v1
yes? shade/noax sst[l=1], x_page, y_page

! In a second window, put the shade key horizontally
! above the plot.

yes? define view/axes/xlim=0.1,0.45/ylim=0.15,`0.15+ylen` v2
yes? set view v2

yes? shade/noax/set sst[l=6], x_page, y_page
yes? let x1 = ($ppl$xorg)
yes? let x2 = ($ppl$xorg)+($ppl$xlen)
yes? let y1 = ($ppl$yorg)+($ppl$ylen)+0.8
yes? let y2 = ($ppl$yorg)+($ppl$ylen)+1.1
yes? ppl shakey 1,0,-0.1,,,,`x1`, `x2`, `y1`, `y2`
yes? ppl shade


The third argument to the shakey command puts the labels on
the upper side of the shade key so they are easier to read.


Boyin Huang wrote:

ferreters:

I notice the following problems in the color legend
(ppl shakey in fill plot) for hammer projection map:

(1) if mp_aspect is not used, the legend can only be
put horizontally, not vertically (not appear).

(2) when a small view port is used (def view/xlim=0.09,0.49/ylim=0.69,0.90 v1),
the horizontal legend disappeared again.

if a large view port (def
view/xlim=0.15,0.85/ylim=0.69,0.90 v1) is set, the horizontal legend is fine.

Can we make the lengend to appear in a small plot? Can
we put the legend in vertical direction without using
mp_aspect?

Thank

=====
Boyin Huang
The Center for Research on the Changing Earth System (CRCES)
10211 Wincopin Circle, Suite 240
Columbia, Maryland 21044
Tel. 410-992-5300/19 (O), 410-461-9339(H) Fax. 410-992-5944, Email. byh@crces.org http://byh.crces.org


_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement