Re: Saving pictures

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 16 2011 - 11:12:44 MDT

Dear Guilherme,

Since you put the "gsn_open_wks" call inside both do loops, this means that "vetor.00001.png" is getting overwritten each time.

You have two possible solutions:

1. Move the gsn_open_wks call outside both do loops. This will cause each new plot to be draw to a new PNG file
with the names "vetor.00001.png", "vetor.00002.png", etc:

;************************************************
; read in zonal [u] and meridional [v] winds (July)
;************************************************

wks = gsn_open_wks("ps","vetor") ; open a ps file

do t = 0,2

do z = 1,3

2. You can leave the gsn_open_wks call inside the do loops, but you will need to name the file something different each time.
For example, if you want to name the file based on the value of the loop variables "t" and "z", you can do something like this:

do t = 0,2

do z = 1,3
. . .
  ps_filename = "vetor" + t + z
  wks = gsn_open_wks("ps",ps_filename) ; open a ps file

This will give you filenames "vetor00.00001.png", "vector01.00001.png", "vetor02.00001.png", etc.

In the next release of NCL, if you only have one plot in your PNG file, the fileame won't have the ".00001" appended.
The files will simply be "vetor00.png", etc.

--Mary

On Sep 16, 2011, at 10:58 AM, Guilherme Martins wrote:

> Please Priyanka, see my script, I used a do loop, but I didn't get save my figures to each time step. Save only the lost time.
>
> Guilherme.
>
> 2011/9/16 priyanka roy <priyankaroy1@gmail.com>
> For figs at each time step I use a do loop for the wks and it creates the output for each time. Also
> wks = gsn_open_wks("ps","vetor."t)
> i think should be without the "t" wks = gsn_open_wks("ps","vetor")
>
> best
> Priyanka
>
>
> On Fri, Sep 16, 2011 at 12:05 PM, Guilherme Martins <jgmsantos@gmail.com> wrote:
> Hi Priyanka,
>
> I want save the figures for each time inside my script, when I run it, save only the last time.
>
> Thanks,
>
> Guilherme.
>
> 2011/9/16 priyanka roy <priyankaroy1@gmail.com>
> Hi Guilherme,
>
> You are already saving as .ps file, when you are doing wks = gsn_open_wks("ps","vetor."t).
>
> To save as png do wks = gsn_open_wks("png","vetor."t)
>
> hope this helps
>
> best
> Priyanka
>
>
> On Fri, Sep 16, 2011 at 11:09 AM, Guilherme Martins <jgmsantos@gmail.com> wrote:
> Hi all,
>
> How did I do to save figures? See my script in attach in the line 41. I tryed a lot options but I didn't have success.
>
> Thanks a lot.
>
> --
> Guilherme Martins
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
> --
> Guilherme Martins
>
>
>
>
>
>
>
> --
> Guilherme Martins
>
>
>
> <02vento.ncl>_______________________________________________
> 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 Fri Sep 16 11:12:51 2011

This archive was generated by hypermail 2.1.8 : Fri Sep 16 2011 - 11:24:25 MDT