PyLab seems to have changed for the worst in Sage 3.3.
In the sage 3.2.3 notebook, I can do the following to
get a passable parabola:

%python
import pylab as p
p.clf()
x = p.arange(-10,11)
y = x**2
p.plot(x,y)
p.savefig('sage0.png')

The p.savefig saves the image in the correct cell
directory where the sage notebooks are stored and
a pretty picture pops up in the notebook().  When
I do this in sage 3.3, I get an error message
indicating that the file type is unknown.  I can
successfully save the file as .eps, but then I
need to click on the nice new download link to
transfer it over to my desktop where I can view
it with Preview.app.

The 3.3 error message is included below,
Mark McClure


-------------------------------------------
Traceback (click to the left for traceback)
...
ValueError: Unknown file type

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/markmcclure/.sage/sage_notebook/worksheets/admin/38/
code/3.py", line 11, in <module>
    p.savefig(\u0027sage0.png\u0027)''', '/Users/markmcclure/.sage/
sage_notebook/worksheets/admin/38/cells/8')
  File "/Users/markmcclure/sage-3.3.rc2/local/lib/python2.5/site-
packages/sage/server/support.py", line 343, in syseval
    return system.eval(cmd, sage_globals, locals = sage_globals)
  File "/Users/markmcclure/sage-3.3.rc2/local/lib/python2.5/site-
packages/sage/misc/python.py", line 56, in eval
    eval(z, globals)
  File "/Users/markmcclure/sage-3.3.rc2/dist/sage-3.3.rc2-i386-Darwin/
Sage.app/Contents/Resources/sage/local/lib/python2.5/site-packages/
SQLAlchemy-0.4.6-py2.5.egg/", line 1, in <module>

  File "/Users/markmcclure/sage-3.3.rc2/local/lib/python2.5/site-
packages/matplotlib/pyplot.py", line 346, in savefig
    return fig.savefig(*args, **kwargs)
  File "/Users/markmcclure/sage-3.3.rc2/local/lib/python2.5/site-
packages/matplotlib/figure.py", line 1001, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/Users/markmcclure/sage-3.3.rc2/local/lib/python2.5/site-
packages/matplotlib/backends/backend_macosx.py", line 268, in
print_figure
    self.write_bitmap(filename, width, height)
ValueError: Unknown file type


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to