From: Fabrice S. <si...@lm...> - 2009-06-30 12:10:01
|
Le lundi 29 juin 2009 à 16:11 -0400, Jae-Joon Lee a écrit : > I think the issue here is to connect points in two different axes, > which is possible but can be a bit difficult. That was my problem > In the svn version of matplotlib, there are some helper classes to > ease this job a bit. Thanks for your pointer. Sadly the mpl.toolkits.axes_grid is not shipped by debian package, and downloading it requires other stuff. So I adapted from the inset_locator.py the attached file. Finally I can "zoom" with the mere script : import matplotlib.pyplot as plt from mpl_axes_grid_inset_locator import zoom_effect S1 = plt.subplot(211) S1.plot(... # xlim (0.,1.2) S2 = plt.subplot(223) S2.plot(... # xlim (0.0095,.012) S3 = plt.subplot(224) S3.plot(... # xlim (0.84,1.) # Labels stuff # [...] patch_props=dict(ec="r", alpha=0.5, fc="r") zoom_effect(S1,S2, 0.01, 0.011, **patch_props) zoom_effect(S1,S3, 0.90, 0.95, **patch_props) It produces two zoom subplots with the wanted patch. |