#4689: Improve docstring for save for graphics objects
---------------------------+------------------------------------------------
 Reporter:  ljpk           |        Owner:  tba       
     Type:  defect         |       Status:  new       
 Priority:  minor          |    Milestone:  sage-3.2.2
Component:  documentation  |   Resolution:            
 Keywords:                 |  
---------------------------+------------------------------------------------
Changes (by mabshoff):

 * cc: mhansen (added)
  * summary:  Documentation documenting the wrong thing => Improve
              docstring for save for graphics objects

Comment:

 With #4672 appplied:
 {{{
 [EMAIL PROTECTED]:/scratch/mabshoff/release-cycle/sage-3.2.2.alpha0$ ./sage
 ----------------------------------------------------------------------
 | Sage Version 3.2.1, Release Date: 2008-12-01                       |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 sage: E=EllipticCurve([1,0])
 sage: Eplot=E.plot()
 sage: Eplot.save?
 }}}
 results in
 {{{
 Type:           instancemethod
 Base Class:     <type 'instancemethod'>
 String Form:    <bound method Graphics.save of >
 Namespace:      Interactive
 File:           /scratch/mabshoff/release-
 cycle/sage-3.2.2.alpha0/local/lib/python2.5/site-
 packages/sage/plot/plot.py
 Definition:     Eplot.save(self, filename=None, xmin=None, xmax=None,
 ymin=None, ymax=None, figsize=(6, 3.7082039324993699), figure=None,
 sub=None, savenow=True, dpi=100, axes=None, axes_labels=None,
 fontsize=None, frame=False, verify=True, aspect_ratio=None,
 gridlines=None, gridlinesstyle=None, vgridlinesstyle=None,
 hgridlinesstyle=None)
 Docstring:

             Save the graphics to an image file of type: PNG, PS, EPS, SVG,
 SOBJ,
             depending on the file extension you give the filename.
                 Extension types can be: file{.png}, file{.ps}, file{.eps},
 file{.svg},
                 and file{.sobj} (for a SAGE object you can load later).

             EXAMPLES:
                 sage: c = circle((1,1),1,rgbcolor=(1,0,0))
                 sage: c.show(xmin=-1,xmax=3,ymin=-1,ymax=3)

                 To correct the apect ratio of certain graphics, it is
 necessary
                 to show with a 'figsize' of square dimensions.

                 sage: c.show(figsize=[5,5],xmin=-1,xmax=3,ymin=-1,ymax=3)

                 sage: point((-1,1),pointsize=30, rgbcolor=(1,0,0))
 }}}
 Rereading the original ticket I now get your main point: the docstring
 does not contain "save", but "show" does save the png and then pops up a
 viewer. We could resolve this by adding a example that uses the save
 method as you suggested, but my guess would be that such example (in case
 it did exist) was either changed or removed since "save('foo.png')" saves
 in the current working directory which is bad for doctesting as a non-
 owner.

 So, what do you want to do? Close this ticket as "wontfix" or we add a
 doctest that saves an image in SAGE_TMP - which is the clean way to deal
 with temporary files.

 Cheers,

 Michael

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4689#comment:4>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to