I’m also trying to do a detailed zoomed area of my plot, but I can’t manage to put the box in the position I want, bbox_to_anchor didn’t work in my case:
axins = zoomed_inset_axes(ax,3,loc=2,bbox_to_anchor=(0,0,0.5,0.5),bbox_transform=ax.transAxes)
This bbox_to_anchor tuple is just an example. I only want to move the zoomed box a little to the right, since the ticklabels overlap.
I really appreciate your help!
2009/7/10 Jae-Joon Lee <lee.j.joon@…287…>
---------- Forwarded message ----------
From: darkside <in.the.darkside@…287…>
Subject: Re: [Matplotlib-users] zoomed in detail box
To: Jae-Joon Lee <lee.j.joon@…2015…87…>
On Thu, Jul 9, 2009 at 7:24 AM, Robin<robince@…287…> wrote:
On Wed, Jul 8, 2009 at 10:57 PM, Jae-Joon Lee<lee.j.joon@…287…> wrote:
If you use the svn version of matplotlib, you may use axes_grid toolkit.
Wow - this is really amazing. Sometimes it can be a bit frustrating
when I’m working to a deadline to figure out the details of Bbox’s and
such but when I find something like this it really makes it worth
while! It does exactly what I want, really easy to use and only took
about 5 lines! (It would be nice if there were some docstrings in
there though :))
On Thu, Jul 9, 2009 at 4:02 AM, Jae-Joon Lee<lee.j.joon@…287…> wrote:
However, It is possible to specify the location of the axes in
normalized axes coordinate.
I’m afraid I didn’t really understand how to apply this in my case…
I guess I would have to set the position and everything by hand
instead of using the zoom helper. I preferred to use the zoom helper,
but found the legend loc settings put it slightly too close to the
edge of the surrounding axes for my taste.
So after checking the docstrings for how to position legends I came up
with something that works, but it required a minor change to the
inset_locator.py to pass the bbox_to_anchor and bbox_transform (it
looks like this was intended since they have None default values):
robin-mbp-3:~ robince$ diff
< axes_locator = AnchoredZoomLocator(parent_axes, zoom=zoom,
axes_locator = AnchoredZoomLocator(parent_axes, zoom=zoom, loc=loc)
With this minor change I get exactly what I want!
Thanks for the catch. I’ll commit the change to the svn soon.
By the way, borderpad keyword is meant to do what you want. However, I
just found that it does not work sine the option is not properly
handled. I’ll fix this in the next commit.
ax1ins = zoomed_inset_axes(ax1, 3,
mark_inset(ax1, ax1ins, loc1=2, loc2=4, fc=“none”, ec=“0.5”)
thanks again, this is really terrific!
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
Matplotlib-users mailing list