Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Jae-Joon Lee
You may use offsetbox module. Here is an complete example. Note that the circle always has a size of 25 point and also is draggable, Regards, -JJ import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import CirclePolygon, Circle x = np.arange(0, 10, 0.1) y = np.exp(-x/2.

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Mads Ipsen
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

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Benjamin Root
On Wednesday, March 9, 2011, Mads Ipsen 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='bla

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Warren Weckesser
On Wed, Mar 9, 2011 at 8:15 AM, Mads Ipsen wrote: > Here is a script (below). > > I want the blue circle to appear as a circle with a 1:1 aspect ratio, > making it look like a circle and not an ellipse. Just like the scale free > circles making up the curve of the damped oscillationsn also shown

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Mads Ipsen
Here is a script (below). I want the blue circle to appear as a circle with a 1:1 aspect ratio, making it look like a circle and not an ellipse. Just like the scale free circles making up the curve of the damped oscillationsn also shown in the plot. Preferably, the circle should also be scal

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Aman Thakral
Could you provide some sample code that recreates the problem (and shows what you're trying to accomplish)? On Wed, Mar 9, 2011 at 8:58 AM, Mads Ipsen wrote: > I tried that, but that will make the entire plot look very strange if xlim > = [0;100] and ylim=[-1:1]. > > What I really want to do is

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Mads Ipsen
I tried that, but that will make the entire plot look very strange if xlim = [0;100] and ylim=[-1:1]. What I really want to do is add a scale free aspect ratio correct circle to the plot. Just like the circles that appear on a scatter plot. Best regards, Mads On 2011-03-09 14:44, Aman Thakr

Re: [Matplotlib-users] Aspect ratio of a circle

2011-03-09 Thread Aman Thakral
Hi Mads, Did you add axis='equal' to you axes command? e.g. ax = fig.add_subplot(111, aspect='equal') -Aman On Wed, Mar 9, 2011 at 6:07 AM, Mads Ipsen 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.