Hi,
how to make this arrow not disappear below the right plot?
Here is the code :
···
from matplotlib.patches import *
import matplotlib.pyplot as P
P.figure(figsize=(5, 3))
ax1 = P.subplot(121)
P.plot([0, 1])
ax2 = P.subplot(122)
P.plot([0, 1])
patch = ConnectionPatch((.5, .5), (.7, .3), ‘data’, ‘data’, axesA=ax1, axesB=ax2,
zorder=100, arrowstyle=‘fancy’,clip_on=False, connectionstyle=‘Angle3’, mutation_scale=100)
ax1.add_patch(patch)
P.savefig(‘cross_arrow.png’)
P.show()
–
Stephane Raynaud
You need to add the patch to the second axes.
patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data',
axesA=ax1, axesB=ax2,
zorder=100, arrowstyle='fancy',
connectionstyle='Angle3',
mutation_scale=10)
ax2.add_patch(patch)
However, this does not work right out of the box currently (which
should be bug).
As a workaround, add a following line and it will work.
patch.set_annotation_clip(False)
It would be appreciated if you file a bug report for a future reference.
Regards,
-JJ
···
On Thu, Dec 3, 2009 at 9:31 AM, Stephane Raynaud <stephane.raynaud@...287...> wrote:
Hi,
how to make this arrow not disappear below the right plot?
Here is the code :
------------------------------------------------------------
from matplotlib.patches import *
import matplotlib.pyplot as P
P.figure(figsize=(5, 3))
ax1 = P.subplot(121)
P.plot([0, 1])
ax2 = P.subplot(122)
P.plot([0, 1])
patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data', axesA=ax1,
axesB=ax2,
zorder=100, arrowstyle='fancy',clip_on=False, connectionstyle='Angle3',
mutation_scale=100)
ax1.add_patch(patch)
P.savefig('cross_arrow.png')
P.show()
------------------------------------------------------------
--
Stephane Raynaud
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options