Mike (or other transforms afficionados),
The thread "[Matplotlib-users] Bug saving semilogy plots with a axvline" started by jsilva@...250... pointed to a bug that appears to be deep in the transforms code. My head is spinning. The problem seems to be related to the propagation of the _invalid attribute in transforms, in the case of a mixed data/axes transform such as ashline uses. The following one-line change in TransformNode, second line from the bottom, works:
Invalidate this :class:`TransformNode` and all of its
ancestors. Should be called any time the transform changes.
# If we are an affine transform being changed, we can set the
# flag to INVALID_AFFINE_ONLY
value = (self.is_affine) and self.INVALID_AFFINE or self.INVALID
# Shortcut: If self is already invalid, that means its parents
# are as well, so we don't need to do anything.
if self._invalid == value:
if not len(self._parents):
self._invalid = value
# Invalidate all ancestors of self using pseudo-recursion.
parent = None
stack = [self]
root = stack.pop()
# Stop at subtrees that have already been invalidated
if root._invalid != value or root.pass_through:
root._invalid = self.INVALID # value <===========
Now, I know this is the wrong solution, because it defeats all the cleverness with the _invalid values; but perhaps it will save you a few minutes in finding the right solution.
To reproduce the problem, do this in ipython -pylab: