Re: how to automate contour levels when paneling multiple frames

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 23 2013 - 11:36:21 MDT

See:

http://www.ncl.ucar.edu/Document/Functions/Built-in/nice_mnmxintvl.shtml

===
A modification ov Example 3

   X1(:,:), X2(:,:), X3(:,:), X4(:,:)

   minX = min( (/ min(X1), min(X2), min(X3), min(X4) /) )
   maxX = max( (/ max(X1), max(X2), max(X3), max(X4) /) )

   maxlev = 18 ; whatever
   mnmxint = nice_mnmxintvl( minX, maxX, maxlev, False)
or
   mnmxint = nice_mnmxintvl( minX, maxX, maxlev, True )

   res@cnLevelSelectionMode = "ManualLevels"
   res@cnMinLevelValF = mnmxint(0)
   res@cnMaxLevelValF = mnmxint(1)
   res@cnLevelSpacingF = mnmxint(2)

On 10/23/13 10:22 AM, jonathan meyer wrote:
> Hi,
> I am plotting multiple frames that compare two datasets on pressure levels.
> I am looking for a way to automate the code to ensure the contours are the same between both datasets and their panels.
> For example:
> I have temperature that needs comparing at 40 pressure levels between two reanalysis datasets.
> Obviously I could create an array of the max/min/spacing values that should be used on each pressure level, but with 40 levels, this can get extensive, and require the panels to be visually inspected first.
> Is there a way to have panel 1 created, while assigning panel 2's contour resources to what panel 1 was set to?
> -----------
> Here is the paraphrased hardcoded (inefficient) code snippet for the plotting I am currently doing.
> ;Tavg(n_datasets, n_lev, n_lat, n_lon)
> ;mn = (/n_lev/);mx = (/n_lev/);sp = (/n_lev/)
> do z = 0, n_lev-1
> resT@cnMinLevelValF = mn(z) resT@cnMaxLevelValF = mx(z) resT@cnLevelSpacingF = sp(z)
> plot(0) = gsn_csm_contour_map(wks, T_avg(0,z,:,:), resT) plot(1) = gsn_csm_contour_map(wks, T_avg(1,z,:,:), resT)
> end do
>
>
> Thanks in advance for all your time/efforts!
> Jon
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 23 11:53:28 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 01 2013 - 08:58:14 MDT