On 02/13/2010 08:52 PM, Jason Grout wrote:
On 02/13/2010 04:43 PM, Robert Miller wrote:
Graphs plot with their most outward vertices chopped off. I think I
can remember this getting fixed three, maybe four times. I fixed it
myself once, and refereed at least one other fix.
Looking on trac, you'd think this was fixed, but in fact it took me
four seconds to come up with an example where it's still an issue:
sage: G = posets.IntegerPartitions(5).hasse_diagram()
sage: G.show()
The "axes_pad" solution is not a viable one, as changing vertex size
and proportions can change the amount of padding needed. Someone needs
to solve this right, and we need a way of keeping it from regressing!
So I guess my second issue would be to have doctests which produce
plots to actually verify that they're not getting garbage.
I agree that the fix in 4.3.2(?) is a bandaid that solves most common
cases.
I think maybe a call to axis('tight') at the right place might be the
right thing to do. See http://sagenb.org/home/pub/1595/ for the effect.
For context, here is the post to the matplotlib list when I was trying
to deal with these issues originally:
http://www.mail-archive.com/matplotlib-us...@lists.sourceforge.net/msg13298.html
In the end, I decided that expanding the axes beyond what the user asked
for (via axes_pad) was better than just expanding the clipping box,
since just expanding the clipping box would look really funny when
frame=True (i.e., things would be hanging outside of the frame).
I don't know why I didn't see axis('tight') before, or maybe saw it and
didn't end up using it. It looks like the option has some side effects
that we probably at least want to think about, though:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axis
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org