#17498: Pictures in the doc through ".. plot::" directive
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.5
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  documentation          |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  bfdc22287e8f702e394753f0dbd55896d045282c
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  public/17498           |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by jhpalmieri):

 The "doctest" syntax for matplotlib's plot directive sounds interesting:
 {{{
   3. Using **doctest** syntax::

        .. plot::
           A plotting example:
           >>> import matplotlib.pyplot as plt
           >>> plt.plot([1,2,3], [4,5,6])
 }}}
 but I can't figure out how to get it to work, mainly because I don't know
 how to convert a Sage graphics object into something matplotlib can plot.
 For example,
 {{{
 sage: C = grsphs.PetersenGraph().plot()
 sage: fig = C.matplotlib() # looks good, right?
 sage: fig.show()
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 ...
 AttributeError: 'NoneType' object has no attribute 'manager'
 Figure.show works only for figures managed by pyplot, normally created by
 pyplot.figure().
 }}}
 Understanding how to do this would let us use just a few lines like
 {{{
 .. plot::

     >>> from sage.all_cmdline import *
     >>> graphs.CubeGraph(8).plot().matplotlib().show()
 }}}
 instead of having to manually save to a temporary file.

--
Ticket URL: <http://trac.sagemath.org/ticket/17498#comment:23>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to