Hello, Not sure this is related, but it's also a behaviour I don't understand when adding a patch. Tony Yu has been providing many insightful explanations on artists, but I'm not there yet... So my apologies if this has been discussed already on this mailing list.
I'm plotting two subplots and I would like to draw a given rectangle on both of them. The rectangle displays if I "add_patch" it to the first subplot only. It does not display (on either subplot) if I "add_patch" it to both subplots. I don't understand why this is. Is this an intentional behaviour? Below is my script: -----------------------------------8<----------------------------------- import matplotlib.pyplot as plt from scipy import ndimage from matplotlib import patches # Next 8 lines don't pertain to the issue--skip. initmid = plt.imread('movie2_t001_z005_c001.png') aftermid = plt.imread('movie2_t002_z005_c001.png') init2 = ndimage.gaussian_filter(initmid, 1) after2 = ndimage.gaussian_filter(aftermid, 1) x_in = 580 y_in = 280 dx_in = 40 dy_in = 40 # Draw rectangles to visualize the area of interest: rect_in = plt.Rectangle((x_in, y_in), dx_in, dy_in, edgecolor='g', facecolor='none') # Plot 2 different views: fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2) plt.gray() ax1.imshow(init2) ax1.add_patch(rect_in) ax2.imshow(after2) # ax2.add_patch(rect_in) plt.show() -----------------------------------8<----------------------------------- If I uncomment the second to last line, I don't get any green rectangle any more. Thanks, Marianne ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users