Open jasongrout opened 15 years ago
And the documentation should be updated, of course.
Something doesn't work in the above patch. I need to figure out how to get the extents of any matplotlib image passed in. Is there an easy way to that information?
Attachment: trac_5128-matplotlib-plot.patch.gz
This makes things a little better, but not much. Currently, you can add an axes object. Note that the doctests involving hist are wrong.
What still needs to be done on this? It would be really good to get this functionality in now that #5448 is merged, so that other tickets could use it. Am I correct that currently there is no way to create a Sage graphics object from a mpl one - the process is one direction only?
Replying to @kcrisman:
What still needs to be done on this? It would be really good to get this functionality in now that #5448 is merged, so that other tickets could use it. Am I correct that currently there is no way to create a Sage graphics object from a mpl one - the process is one direction only?
That's correct. This ticket is the other direction.
Attachment: trac_5128-matplotlib-plot.2.patch.gz
apply instead of previous patch.
apply instead of previous patches
Attachment: trac_5128-matplotlib-plot.3.patch.gz
I've attached another iteration. I've also posted to the matplotlib users mailing list about the problems in the above patch.
The matplotlib thread is here: http://thread.gmane.org/gmane.comp.python.matplotlib.general/19547
It sounds like we'll probably have to wait until someone (one of us??) volunteers to help on the matplotlib side.
On sage-support, Karl-Dieter asked me to comment about an issue this ticket might solve. That thread concerns using SageTeX to plot matplotlib graphics -- if this ticket does indeed allow one to easily convert mpl objects to Sage graphics objects, then yes, it will solve the problem in that thread.
(Note, though, that I think I described a much more general solution there -- albeit one that will require some setup code every time you want to use it.)
Changed keywords from none to matplotlib
cc me!
This is related to #10656, which asks for functionality to convert a GraphicsArray()
object to a Graphics()
object.
By the way, is this ticket still waiting for something to happen with matplotlib, or is it in working order?
As far as I know, we're stalled waiting for something to happen to matplotlib first.
The matplotlib thread is here: http://thread.gmane.org/gmane.comp.python.matplotlib.general/19547
This server is not only down, the replacement news.gmane.io is not exactly obvious how to access this one any more. I think that this is the discussion in question: https://discourse.matplotlib.org/t/saving-images-using-pure-matplotlib-in-sage-cuts-off-the-bottom-part-and-produces-corrupt-file/12286/7 or possibly https://discourse.matplotlib.org/t/saving-an-axes-to-draw-in-a-different-figure/12185
See also https://groups.google.com/g/sage-support/c/N2cgEW3QUG4 for a SageTeX point of view.
It sounds like we'll probably have to wait until someone (one of us??) volunteers to help on the matplotlib side.
I wonder what the current state of the art is.
This provides an easy way to make a matplotlib image and combine it with other Graphics() objects:
Example use:
This just needs to be put in a file in the plot/ directory and an entry added to all.py.
CC: @nilesjohnson
Component: graphics
Keywords: matplotlib
Issue created by migration from https://trac.sagemath.org/ticket/5128