Re: Force graphic to be written to file

From: Paulo Santiago <paulohsm_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 09 2013 - 08:41:59 MST

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
Received on Mon Dec 9 08:42:31 2013

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