Re: Better way to minimize white space surrounding plots

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 22 2011 - 15:47:36 MDT

A minor variation of Andrew Ansorge's suggestion

pltType = "..." ; ps, eps, pdf, ....
pltName = "..." ; whatever
pltDir = ".../" ; plot directory ["./" is current directory]

pltPath = pltDir + pltName

wks = gsn_open_wks(pltType,pltPath)
gsn_define_colormap(wks,"...")

   res = true
       :
   plot= ....

system("convert -trim "+pltPath+"."+pltType+" "+pltPath+"."++pltType)

other options can be added, as desired

system("convert -density 88 -trim "+pltPath+"."+pltType+"
"+pltPath+"."+pltType)

Say you wanted to convert to jpeg or png ....

    system("convert -trim "+pltName+"."+pltType+"
"+pltDir+pltName+"."+jpeg")

On 3/22/11 2:59 PM, Andrew Ansorge wrote:
> Hi Madeleine:
>
> If Imagemagick is installed, you could use the convert command with the
> trim option, which will remove the white space.
>
> convert -trim file1.ps <http://file1.ps/> file2.ps <http://file2.ps/>
>
> I hope that simple solution helps you.
>
> Cheers,
> Andrew
>
> On Tue, Mar 22, 2011 at 2:51 PM, Madeleine Patterson
> <madeleine.patterson77@gmail.com
> <mailto:madeleine.patterson77@gmail.com>> wrote:
>
> Hi NCLers,
>
> Just wondering if theres a better way to get rid of most of the
> white space surrounding a gsn_csm_contour_map_ce map (or indeed any
> other type of plot), other than (or perhaps in addition to) the
> "gsnMaximize = True" command? I'd like to find a way to save myself
> manually cropping a bunch of of figures.
>
> Thanks for any suggestions.
>
> Madeleine.
>
>
>
> _______________________________________________
> 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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 22 15:47:43 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT