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

 Hello !

 > Yo!  Do you think that using the built-in `.matplotlib()` method for all
 our graphics (well, 2d) would work?  (For instance, we already usually
 have tight layout.)

 I do not understand your question. Here is how the draw function currently
 works:

 1) Take a Sage graphical object and save it as a png file
 2) Load the png with matplotlib

 Then, matplotlib's 'plot' directive knows how to handle it and add the
 pictures in the html documentation. Pretty simple from out point of view,
 and will work with anything we can turn into a jpg file.

 In particular (though I do not know if this is what you asked) the 'tight
 layout' parameter will have an impact on the .jpg file we *produce*. The
 'tight layout' I added in the code is a parameter of the picture produced
 by matplotlib from our jpg file.

 > I would say that your `draw` function is more of a proof-of-concept, not
 really something we would want to actually add.

 Well. I would also prefer calls to `.show()` to produce plots in the doc,
 but really I do not know how to write this branch better than how it is
 done. If it turns out that nobody can rewrite it better, I would still
 prefer to have this 'draw' function around and be able to add pictures to
 the doc than nothing at all.

 > But we could add instructions about how to use the `PLOT::` directive
 right now to have them actually show up in the docs.

 Again I do not understand: do you mean instructions like the ones I added
 in my last commit ?

 > One could create a major patch bomb by changing the `sage/plot/` files
 to have all plots use this :)

 Still do not understand what you mean by "to have all plots use this".
 Note that even if we were able to turn all calls to `.show()` into a
 picture in the reference manual it would not necessarily be a good idea. I
 remember a time when peopl complained a bit about the size of our
 documentation, and.... Adding pictures to that would probably mean more
 than a couple of megabytes.

 Plus it would mean having Sphinx go through all doctests when building the
 doc, and that's not a good idea either.

 Good evening,

 Nathann

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