#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 schilly):

 Replying to [comment:23 jhpalmieri]:
 > 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.

 That's exactly what I've posted earlier about LMFDB
 [https://github.com/LMFDB/lmfdb/blob/master/lmfdb/utils.py#L524 here].


 {{{
 from matplotlib.backends.backend_agg import FigureCanvasAgg
 fig = P.matplotlib()
 fig.set_canvas(FigureCanvasAgg(fig))
 fig.savefig(..., format='png')
 }}}

 LMFDB also uses `StringIO` to avoid the creation of temporary files. I
 think that's a good thing in general and only has benefits. I just don't
 know how the underlying mechanism here works, but I would recommend doing
 that.

--
Ticket URL: <http://trac.sagemath.org/ticket/17498#comment:26>
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