Re: Force graphic to be written to file

From: Kyle Griffin <ksgriffin2_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 09 2013 - 08:49:52 MST

Hi Paulo,

Your original problem likely still occurs in your corrected script, you
just have no additional lines of code that would bring the problem to the
surface. In newer version of NCL, it is required to delete the workstation
before operating on it outside of NCL. As a result, your first script
should work just fine with a simple delete(wks) after your plotting and
before your use of the system command. Of course, the direct output to .eps
format is also just as viable of a solution. Hope this helps with any
similar circumstances in the future.

Kyle

----------------------------------------
Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
Room 1421
1225 W Dayton St, Madison, WI 53706
Email: ksgriffin2@wisc.edu

On Mon, Dec 9, 2013 at 9:41 AM, Paulo Santiago <paulohsm@gmail.com> wrote:

> Dear NCL users,
>
> I just found that I can output my graphics directly to .epsi format,
> setting it in the wks creation.
>
> This saves me one "system(ps2epsi ...)" command every plot, and makes
> plots without big white bounds.
>
> Then, you can ignore my last message.
>
> Thank you!
>
> Cheers,
>
>
> 2013/12/9 Paulo Santiago <paulohsm@gmail.com>
>
>> Dear NCL users,
>>
>> I'm making some plots in postscript (.ps) format with gsn_csm_xy and
>> gsn_csm_pres_hgt commands.
>>
>> After every plot command I convert the .ps file to .epsi with ps2epsi in
>> order to crop out white page bounds. For example,
>>
>> res = True
>> res@cnFillOn = True
>> res@cnLinesOn = False
>> res@lbOrientation = "Vertical"
>> res@vpHeightF = 0.2 ;0.3
>> res@vpWidthF = 1.0 ;0.4
>> res@gsnMaximize = True
>> res@gsnPaperOrientation = "portrait"
>> time_axis_labels(time,res,restick)
>> ...
>> wks = gsn_open_wks("ps", "agcm_uvel")
>> gsn_define_colormap(wks,"rainbow")
>> * plot = gsn_csm_pres_hgt(wks,uvel,res)*
>> * system("ps2epsi agcm_uvel.ps <http://agcm_uvel.ps> agcm_uvel.eps")*
>>
>> For every "system(ps2epsi ...)" command I get a "blank page!!" message
>> from ps2epsi. The conversion from .ps to .epsi is not made, although I
>> get valid .ps files.
>>
>> However, if I put all "system(ps2epsi ...)" after the sequence of
>> gsn_csm_pres_hgt commands, all but the last conversion works properly.
>>
>> The last plot in script converts without problems when I run ps2epsi
>> outside my NCL script, after I have run it.
>>
>> It seems that the graphic is not saved to file until the next plot
>> command or until the end of script execution.
>>
>> I'd like to know how to address this issue. Is there a command I can use
>> just after every plot command to force NCL write the graphic to file?
>>
>> Cheers,
>> --
>> Paulo Santiago
>> Ph.D. Student in Meteorology
>> Brazilian National Institute for Space Research
>> Phone.: +55(12)31868637
>>
>
>
>
> --
> Paulo Santiago
> Doutorado em Meteorologia
> Programa de Pós-Graduação em Meteorologia
> Instituto Nacional de Pesquisas Espaciais
> Tel.: (12) 3186 8637
>
> _______________________________________________
> 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 Mon Dec 9 08:50:24 2013

This archive was generated by hypermail 2.1.8 : Fri Dec 13 2013 - 11:39:30 MST