[ncl-talk] removal of white space

Mary Haley haley at ucar.edu
Mon Aug 1 14:17:39 MDT 2016


Geeta,

NCL always draws its graphics to a square, even if your graphic only takes
up the top part of a square.

Since you are drawing a panel plot with 2 rows and 17/18 columns, this is
going to give you a lot of white space at the bottom.

You can post-process the PNG image after you are done drawing to the
workstation.

First, I suggest making the PNG a higher resolution:

  wtype = "png"
  wtype at wkWidth  = 2500
  wtype at wkHeight = 2500
  Wks_Rain      =   gsn_open_wks(wtype,"NearSurfRainfnl")

then, after your gsn_panel call, you need to "delete" the workstation,
which effectively closes the PNG file, and use "convert" to trim out the
undesired white space. The "-border 8" puts a little bit of white space
around the image:

   delete(Wks_Rain)
   cmd = "convert -trim -geometry 2500x2500 +repage -border 8 -bordercolor
white -background white -flatten NearSurfRainfnl.png NearSurfRainfnl.png"
   system(cmd)

-Mary




On Sat, Jul 30, 2016 at 6:45 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> I am unable to remove white space below my plot. I have tried two methods,
>  Panel_Res at gsnPanelWhiteSpacePercent = 0.0
> and
>
>  res at gsnMaximize          =   True
>
> but no change is there is plot. dont know if the order of these two has an
> impact.
> kindly suggest
>
>
> 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/20160801/2814d824/attachment.html 


More information about the ncl-talk mailing list