saving displayed fig as ps fails

SVN revision 2774, linux 64-bit, TkAgg, NumPy. If I

    > create a figure on the screen (TkAgg back end), when I try
    > to save it as .ps, the resulting file displays and prints
    > as blank. However I can save it as .eps (or png)
    > perfectly well.

tkagg passes its printing off to agg, which passes both *.ps and *.eps
to backend_ps with no further processing. So if there is a problem,
it should show up on a pure PS backend, eg

import matplotlib
matplotlib.use('PS')
from pylab import figure, show
fig = figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3])
fig.savefig('test.ps')
fig.savefig('test.eps')

Is anyone seeing problems with this?

There is, however, a known bug when using tkagg from pylab, after you
click the save button pylab loses the current figure. This appears to
be a tkinter bug and I reported it on python-list and go no response.
If this is the cause of your problem, it is not about PS vs EPS vs
PNG, but about which filetype you try and save first. The first one
would work, and subsequent ones would fail.

JDH

    > SVN revision 2774, linux 64-bit, TkAgg, NumPy. If I
    > create a figure on the screen (TkAgg back end), when I try
    > to save it as .ps, the resulting file displays and prints
    > as blank. However I can save it as .eps (or png)
    > perfectly well.

tkagg passes its printing off to agg, which passes both *.ps and *.eps
to backend_ps with no further processing. So if there is a problem,
it should show up on a pure PS backend, eg

import matplotlib
matplotlib.use('PS')
from pylab import figure, show
fig = figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3])
fig.savefig('test.ps')
fig.savefig('test.eps')

Is anyone seeing problems with this?

John,
I tried this and, again, the ps fails but eps is OK.

There is, however, a known bug when using tkagg from pylab, after you
click the save button pylab loses the current figure. This appears to
be a tkinter bug and I reported it on python-list and go no response.
If this is the cause of your problem, it is not about PS vs EPS vs
PNG, but about which filetype you try and save first. The first one
would work, and subsequent ones would fail.

This certainly wasn't the problem. Originally I tried saving png first
(OK), ps (not OK),
eps (third time lucky, OK.)

Thanks for responding so quickly. George.

···

On 20/09/06, John Hunter <jdhunter@...4...> wrote: