#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):
I think that `savefig` will work, but doesn't that save to a file? (Unless
we use Harald's suggestion, that is.) The lines
{{{
3. Using **doctest** syntax::
.. plot::
A plotting example:
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3], [4,5,6])
}}}
from `matplotlib.sphinxext.plot_directive` suggest that if we give it the
right plotting command, whatever that is, we should be able to produce an
image on the fly.
For me, it boils down to the fact that I don't understand Sage's graphics,
I don't understand matplotlib's graphics, and I absolutely don't
understand the interaction between the two.
Harald's suggestion seems good, though. I'd rather not create temporary
files.
Another option: we could read all of the doctests once and create all of
the missing pictures, and then ship the graphics files as part of the
documentation source (as we do already with a handful of files). I'm
imagining a new target in the `Makefile` which would somehow do this.
Which is better: producing the pictures once and distributing them with
every copy of Sage, or making the source distribution smaller and
producing the pictures every time the documentation is built? Maybe I'm
really asking about the long term plans: if we are only planning to add a
few pictures, it doesn't matter too much (to me, anyway) how it's done.
But if we are planning to add a lot of pictures, then we want to consider
how best to automate it, and also what the costs to the developers and
users will be: will docbuilding suddenly take much longer because we're
building 500 plots each time, or will the source code be larger because
we're including 500 plots? If we include the plots, what's the best
format? '.sobj' and '.pdf' look like the smallest in a few examples I just
tried...
--
Ticket URL: <http://trac.sagemath.org/ticket/17498#comment:27>
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.