[ncl-talk] panel plots sizes

Mary Haley haley at ucar.edu
Tue Apr 12 12:32:18 MDT 2016


Toshi,

NCL always draws to a square canvas, so even if you specify a non-square
ratio with wkWidth and wkHeight, you will get a 1026x576 image, but the
plots will be drawn to a 576x576 part of that image.

My suggestion is to set both wkWidth and wkHeight to the same value that is
the larger of the two sizes (1026x1026).  NCL will then expand the image
without skewing the aspect ratio.

You will still end up with white space, however, around the top and
bottom.  You can then use the free "convert" tool to further post-process
the image. So, after the gsn_panel call, delete "wks" (which closes the
image) and then use "system" to call the convert command:

  delete(wks)
  system("convert -trim -geometry 1026x576 panel.png panel_trim.png")


We do have a trouble ticket for implementing more flexibility with PNG
output, but in the meantime, hopefully this will serve as a work-around.

I've attached a sample script in case anybody else is having trouble with
this issue. You can download the data file it uses from

http://www.ncl.ucar.edu/Applications/Data/cdf/sst8292a.nc

--Mary

On Mon, Apr 11, 2016 at 12:58 PM, Matsui, Toshihisa (GSFC-612.0)[UNIV OF
MARYLAND] <toshihisa.matsui-1 at nasa.gov> wrote:

> Hello NCL users
>
> I am in the middle of transition from GrADS to NCL…
> But in tough time for plotting very easy plots.
>
> Point is that when I specified the width and height in WKS,e.g.,
>
>   type at wkWidth =  1026
>   type at wkHeight =  576
>
> My panel plots does not use all space in workstation (this try to show two
> square plots in one workstation), even if I use gsnMaximize.
>
>    pnlres at gsnMaximize        = True
>    gsn_panel(wks,(/plots/),(/1,2/),pnlres)
>
>
> It suppose to use entire space of 1026x576, but plots appeared in the
> middle of workstation, only.
> I’ve tested alot of options in website, but still does not work well, like
> this…
>
> https://dl.dropboxusercontent.com/u/80419501/data/Screenshot%202016-04-11%2014.56.55.png
>
> Toshi
>
> --------------------------------------------------
> Toshihisa Matsui,Ph.D -  ESSIC/UMCP
> Associate Research Scientist
> Code612 NASA Goddard Space Flight Center
> Greenbelt, MD, 20771
> Voice:(301)-614-5658
> E-mail: toshihisa.matsui-1 at nasa.gov
>
> Personel Web <http://cloud.gsfc.nasa.gov/index.php?section=24>
> Group Web <http://cloud.gsfc.nasa.gov/index.php?section=7>
> GSDSU <http://cloud.gsfc.nasa.gov/index.php?section=14>
> NU-WRF <http://nuwrf.gsfc.nasa.gov/>
> --------------------------------------------------
>
>
> _______________________________________________
> 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/20160412/9a74088d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: panel_trim.png
Type: image/png
Size: 247518 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160412/9a74088d/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: panel_fix_png_size.ncl
Type: application/octet-stream
Size: 2734 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160412/9a74088d/attachment.obj 


More information about the ncl-talk mailing list