|
From: Dale C. <dal...@he...> - 2012-09-12 15:21:25
|
[replying only to the list -Dale]
On Sep 12, 2012, at 07:02 , Jae-Joon Lee wrote:
> Your code works as expected in my side.
I wasn't quite sure what to expect, but based on Jae-Joon's note:
> So, changing (0.5, 0.5) to something like (0.6, 0.5) has no effect in
> your side?
It seems to work on my installation. I actually changed to (0.3,0.5) which made a nice view.
> Hmm, what is you matplotlib version?
OS X 10.7.4 using python and tools from fink:
i python27 1:2.7.3-1
i python27-shlibs 1:2.7.3-1
i matplotlib-basemap-py27 1.0.2-1
i matplotlib-py27 1.1.1-1
i numpy-py27 1.6.1-1
Thanks to the folks who make this work,
-Dale
> Maybe this is a bug in old version of matplotlib.
>
> Regards,
>
> -JJ
>
>
> On Wed, Sep 12, 2012 at 6:16 PM, darkside <in....@gm...> wrote:
>> Thank you for your help.
>>
>> A simple example that doesn't work for me is:
>> ----------------------------------------
>> import pylab as p
>> import numpy as np
>> from mpl_toolkits.axes_grid.inset_locator import zoomed_inset_axes
>> from mpl_toolkits.axes_grid.inset_locator import mark_inset
>> from mpl_toolkits.axes_grid.anchored_artists import AnchoredSizeBar
>> from matplotlib.ticker import MaxNLocator
>>
>> fig = p.figure(figsize=(12,8))
>> ax = p.subplot(111)
>>
>> z = p.arange(0,1.415,0.01)
>> d = z**2+np.random.random(len(z))
>>
>> ax.plot(z,d,'ro',label='text')
>>
>> p.xlabel('z',fontsize=18)
>> p.ylabel('Luminosity distance',fontsize=18)
>> p.grid(True)
>>
>> axins = zoomed_inset_axes(ax,
>> 3,bbox_to_anchor=(0.5,0.5),bbox_transform=ax.figure.transFigure, loc=2)
>>
>>
>> axins.plot(z,d,'r.')
>>
>> ax.legend(loc=2,bbox_to_anchor=(1,1))
>>
>> x,y = (0.86,1.3)
>> x2,y2 = (1,1.7)
>> axins.set_xlim(x,x2)
>> axins.set_ylim(y,y2)
>> axins.tick_params(axis='both',labelsize=12)
>> axins.xaxis.set_major_locator(MaxNLocator(2))
>> axins.yaxis.set_major_locator(MaxNLocator(3))
>>
>> mark_inset(ax,axins,loc1=1,loc2=3, fc="none", ec="0.5")
>>
>> p.draw()
>> p.show()
>> -----------------------------------------------------------
>> The "bbox_to_anchor" label is supposed to move the zoomed axis, but it does
>> nothing, no matter what two numbers I place there.
>> I guess that I miss something, but I can't figure out what. I really
>> appreciate your help.
>>
>> Best regards,
>> Illa
>>
>>
>>
>> 2012/9/5 Jae-Joon Lee <lee...@gm...>
>>>
>>> On Mon, Aug 20, 2012 at 10:50 PM, darkside <in....@gm...>
>>> wrote:
>>>> I am using zoomed_inset_axes, but the default position overlaps the
>>>> yticks
>>>> and the parent axe ticks, so I am trying:
>>>> axins = zoomed_inset_axes(ax,
>>>> 3,bbox_to_anchor(0.5,1),bbox_transform=ax.figure.transFigure, loc=2)
>>>
>>> This is supposed to work, and my quick test did work. Can you post a
>>> complete but simple exampl?
>>>
>>> Regards,
>>>
>>> -JJ
>>
>>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|