[ncl-talk] plotting help in ncl

Mary Haley haley at ucar.edu
Tue Sep 22 10:05:27 MDT 2015


Alan is correct about how to do this, and I don't think we actually have
any intentional examples on this.

One thing I wanted to add  is that if you need to do something with the PNG
image, like trim the white space using "convert", then you can use the
"delete" command inside the loop to force a close of the PNG image before
you call convert. This can be really useful if you want to import the PNG
into something like PowerPoint:

plot_names = (/"plot_name", "a_new_plot", "the_plot_strikes_back",
"return_of_the_plot","the_plot_awakens"/)
do i=0,4
  wks = gsn_open_wks("png", plot_names(i) )
  ....
  plot = gsn_csm_xxxx(wks,...)

; Remove white space from PNG image
  delete(wks)
  system("convert -trim " + plot_names(i) + ".png " + plot_names(i) +
".trimmed.png")
end do

--Mary


On Mon, Sep 21, 2015 at 6:51 AM, Alan Brammer <abrammer at albany.edu> wrote:

> It is possible.  I'm sure there are examples on the ncl pages.  Here are
> two easy ways.
>
> do i=0,10
>   wks = gsn_open_wks("png", "plot_name"+i)
>   plot....
> end do
>
>
> plot_names = (/"plot_name", "a_new_plot", "the_plot_strikes_back",
> "return_of_the_plot"/)
> do i=0,3
>   wks = gsn_open_wks("png", plot_names(i) )
>   ....
> end do
>
>
>
> On Mon, Sep 21, 2015 at 3:24 AM, Arun Kumar Dwivedi <
> dwivedi.arunkumar at gmail.com> wrote:
>
>> Dear Madam/Sir,
>> I want to change the plot name in every loop in NCL. Is it possible ??
>>
>>
>> Thanks & Regards
>> Arun Kumar Dwivedi,
>> Mob :+919546189035
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> 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/20150922/5ef9d519/attachment.html 


More information about the ncl-talk mailing list