[ncl-talk] unable to get plots of equal size in the panel plot.

Mary Haley haley at ucar.edu
Wed Dec 19 09:17:12 MST 2018


Geeta,

By default, NCL doesn't let you change aspect ratio of map plots. If you
really want to "distort" the map, you must set this resource:

  res at mpShapeMode    = "FreeAspect"

You can see an example at:

http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex14

Also, I noticed you are getting this warning, which is important to pay
attention to:

is_valid_latlon2d_attr: Warning: The 'lon2d' attribute must either be the
same dimension sizes as the data, or one element larger in both
directions.  Your data will most likely not be overlaid on the map
correctly.
is_valid_latlon2d_attr: Warning: The 'lat2d' attribute must either be the
same dimension sizes as the data, or one element larger in both
directions.  Your data will most likely not be overlaid on the map
correctly.

This warning happens if the two-dimensional data array you're plotting and
its lat2d / lon2d attribute arrays are not the same size.  You need to look
into this to make sure you are plotting things correctly.

--Mary



On Wed, Dec 19, 2018 at 4:47 AM Geeta Geeta <geetag54 at yahoo.com> wrote:

> Hi
> I am making panel plots (4 plots 2 rows, 2 columns) and made their sizes
> equal by
> getvalues Plot(0)
>       "vpWidthF"  : vpw
>       "vpHeightF" : vph
>     end getvalues
>
> Then I am using the the same values of vpw and vph for the rest 3 plots.
> like this.
> setvalues Plot(1)
>    "vpHeightF"   : vph
>    "vpWidthF"    : vpw
>    end setvalues
>
>     print("plot1 vph and vpw    "+vph+" "+vpw)
>
>   draw(Plot(1))
>
> setvalues Plot(2)
>    "vpHeightF"   : vph
>    "vpWidthF"    : vpw
>      end setvalues
>     print("plot2 vph and vpw    "+vph+" "+vpw)
> draw(Plot(2))                      ------------------------------ Till
> plot3.
>
> the output of the plots is printed down.
>
> See http://www.ncl.ucar.edu/ for more details.
> (0) plot0 vph and vpw    0.553889 0.738519
> (0) plot1 vph and vpw    0.553889 0.738519
> (0) plot2 vph and vpw    0.553889 0.738519
> (0) is_valid_latlon2d_attr: Warning: The 'lon2d' attribute must either be
> the same dimension sizes as the data, or one element larger in both
> directions.  Your data will most likely not be overlaid on the map
> correctly.
> (0) is_valid_latlon2d_attr: Warning: The 'lat2d' attribute must either be
> the same dimension sizes as the data, or one element larger in both
> directions.  Your data will most likely not be overlaid on the map
> correctly.
> (0) plot3 vph and vpw   0.553889 0.738519
> (0) There are 4 valid plots out of 4 total plots
> (0) -------Panel viewport values for each plot-------
> (0)    plot #0
> (0)    new x,y      = 0.0290952,0.807537
> (0)    orig wdt,hgt = 0.738519,0.553889
> (0)    new wdt,hgt  = 0.380837,0.285628
> (0) -------Panel viewport values for each plot-------
> (0)    plot #1
> (0)    new x,y      = 0.529095,0.807537
> (0)    orig wdt,hgt = 0.738519,0.553889
> (0)    new wdt,hgt  = 0.380837,0.285628
> (0) -------Panel viewport values for each plot-------
> (0)    plot #2
> (0)    new x,y      = 0.0290952,0.467565
> (0)    orig wdt,hgt = 0.461574,0.553889
> (0)    new wdt,hgt  = 0.238023,0.285628
> (0) -------Panel viewport values for each plot-------
> (0)    plot #3
> (0)    new x,y      = 0.529095,0.467565
> (0)    orig wdt,hgt = 0.738519,0.553889
> (0)    new wdt,hgt  = 0.380837,0.285628
> (0) -------min/max X,Y viewport positions for plots-------
> (0) min/max x viewport position = 0.0290952/0.529095
> (0) min/max y viewport position = 0.467565/0.807537
> (0) -------min/max NDC values for all objects in panel-------
> (0) min/max x position = -0.00618936/1.01496
> (0) min/max y position = 0.142153/0.834196
>
> when I use the resource,            Panelres at gsnPanelDebug              =
>  True,
> it gives me info reg the 4 plots.  But the 3rd PLOT is smalleer in width.
> why is that happening.
> plot is attached.
>
> thanks
> Geeta.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181219/b2284b04/attachment.html>


More information about the ncl-talk mailing list