Thanks.

The intention is to make the added circle dragable by the mouse by 
listening to mouse press, move, and release.

That means that I have to modify the data of the added scatter data. I 
believe that the axes.scatter() method returns a 
matplotlib.collections.CircleCollection object. How do I change the 
position of the circles (one circle) contained in this object?

Mads

On 2011-03-09 15:28, Benjamin Root wrote:
> On Wednesday, March 9, 2011, Mads Ipsen<madsip...@gmail.com>  wrote:
>> Hi,
>>
>> I am using the Qt4 based back engine for displaying a 2D plot in a
>> widget. The plot typically contains lots of line plots. Suppose I add a
>> CirclePolygon to the plot like this:
>>
>> circle = CirclePolygon((x,y), radius=0.04, edgecolor='black',
>> facecolor='red', zorder=1)
>> axes.add_patch(circle)
>>
>> Then when I start to zoom in the window the aspect ratio of the circle
>> is not preserved (it appears like an ellipse). If you plot a line with
>> points, displaying its points using circles, these circles do have their
>> aspect ratio (and size) preserved. There must be some approach for
>> achieving the same effect for a manually added circle.
>>
>> Any help is appreciated,
>>
>> Best regards,
>>
>> Mads
>>
> Mads,
>
> The way this is done is tricky.  The transform object assigned to the
> circles in plot() and scatter() are different than the default when
> you make a circle polygon yourself.  The easiest way to get them is to
> just simply use scatter() and pass in your own size value.
>
> I hope that helps!
> Ben Root

-- 
+--------------------------------------------------------------+
| Mads Ipsen, Scientific developer                             |
+-------------------------------+------------------------------+
| QuantumWise A/S               | phone:          +45-29716388 |
| Lersø Parkallé 107            | www:     www.quantumwise.com |
| DK-2100 Copenhagen Ø, Denmark | email:  mads.ip...@gmail.com |
+-------------------------------+------------------------------+



------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to