SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Thomas R. <tho...@gm...> - 2009年04月30日 00:52:35
Hi,
Is there an easy way to draw a patch or a patchcollection such that it 
always stays at the same relative position in a set of axes, rather 
than at the same pixel position? So for example, I would want to plot 
it at (0.1,0.1) relative to the axes, and if I zoom in I would still 
want it to stay at (0.1,0.1)
Thanks for any advice,
Thomas
From: Eric F. <ef...@ha...> - 2009年04月30日 01:13:21
Thomas Robitaille wrote:
> Hi,
> 
> Is there an easy way to draw a patch or a patchcollection such that it 
> always stays at the same relative position in a set of axes, rather 
> than at the same pixel position? So for example, I would want to plot 
> it at (0.1,0.1) relative to the axes, and if I zoom in I would still 
> want it to stay at (0.1,0.1)
With ipython -pylab:
ax = gca()
ax.fill([0.1, 0.2, 0.15], [0.1, 0.1, 0.15], transform=ax.transAxes)
draw()
then pan, zoom at will.
Eric
From: Thomas R. <tho...@gm...> - 2009年04月30日 01:17:51
Thanks!
Is there an easy way to keep a reference to patches? I notice that for 
example
p = ax.add_patch(Circle((0.5,0.5),radius=0.5))
does not work (p is not a reference to the patch). Is there a way to 
keep a reference so I can update the properties of the patch at a 
later time?
Cheers,
Thomas
On 29 Apr 2009, at 21:13, Eric Firing wrote:
> Thomas Robitaille wrote:
>> Hi,
>> Is there an easy way to draw a patch or a patchcollection such that 
>> it always stays at the same relative position in a set of axes, 
>> rather than at the same pixel position? So for example, I would 
>> want to plot it at (0.1,0.1) relative to the axes, and if I zoom 
>> in I would still want it to stay at (0.1,0.1)
>
> With ipython -pylab:
>
> ax = gca()
> ax.fill([0.1, 0.2, 0.15], [0.1, 0.1, 0.15], transform=ax.transAxes)
> draw()
>
> then pan, zoom at will.
>
> Eric
>
From: Eric F. <ef...@ha...> - 2009年04月30日 01:53:29
Thomas Robitaille wrote:
> Thanks!
> 
> Is there an easy way to keep a reference to patches? I notice that for 
> example
> 
> p = ax.add_patch(Circle((0.5,0.5),radius=0.5))
> 
> does not work (p is not a reference to the patch). Is there a way to 
> keep a reference so I can update the properties of the patch at a later 
> time?
Split the command up:
p = Circle(...)
ax.add_patch(p, ...)
(add_* could be modified to return the reference; maybe this would be 
worthwhile.)
Eric
> 
> Cheers,
> 
> Thomas
> 
> On 29 Apr 2009, at 21:13, Eric Firing wrote:
> 
>> Thomas Robitaille wrote:
>>> Hi,
>>> Is there an easy way to draw a patch or a patchcollection such that 
>>> it always stays at the same relative position in a set of axes, 
>>> rather than at the same pixel position? So for example, I would want 
>>> to plot it at (0.1,0.1) relative to the axes, and if I zoom in I 
>>> would still want it to stay at (0.1,0.1)
>>
>> With ipython -pylab:
>>
>> ax = gca()
>> ax.fill([0.1, 0.2, 0.15], [0.1, 0.1, 0.15], transform=ax.transAxes)
>> draw()
>>
>> then pan, zoom at will.
>>
>> Eric
>>
> 
From: Christopher B. <Chr...@no...> - 2009年04月30日 22:57:07
Eric Firing wrote:
> Split the command up:
> p = Circle(...)
> ax.add_patch(p, ...)
> 
> (add_* could be modified to return the reference; maybe this would be 
> worthwhile.)
+1
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Eric F. <ef...@ha...> - 2009年05月01日 19:04:41
Christopher Barker wrote:
> Eric Firing wrote:
>> Split the command up:
>> p = Circle(...)
>> ax.add_patch(p, ...)
>>
>> (add_* could be modified to return the reference; maybe this would be 
>> worthwhile.)
> 
> +1
> 
> 
> 
Done in r7077.
Eric
From: Thomas R. <tho...@gm...> - 2009年05月02日 00:39:46
Thanks!
Thomas
On 1 May 2009, at 15:04, Eric Firing wrote:
> Christopher Barker wrote:
>> Eric Firing wrote:
>>> Split the command up:
>>> p = Circle(...)
>>> ax.add_patch(p, ...)
>>>
>>> (add_* could be modified to return the reference; maybe this would 
>>> be
>>> worthwhile.)
>>
>> +1
>>
>>
>>
>
> Done in r7077.
>
> Eric
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code 
> vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /