|
From: Jason G. <jas...@cr...> - 2012-11-05 21:22:57
|
On 11/5/12 3:19 PM, Benjamin Root wrote: > > > On Mon, Nov 5, 2012 at 3:51 PM, Brad Malone <bra...@gm... > <mailto:bra...@gm...>> wrote: > > Hello, > > I am trying to plot some small circles in my plotting window, in > addition to the curves I'm already plotting. If I don't want to set > my x- and y- axis scales equal to each other, a naive drawing of a > circle results in an ellipse. To fix this problem I found some nice > example code online here : > http://stackoverflow.com/questions/9230389/why-is-matplotlib-plotting-my-circles-as-ovals, > which solves the problem by basically plotting an ellipse, but an > ellipse which will look like a circle in the display window. > > That works all fine for me, but then, if I change my xlim or ylim > using ax1.set_xlim((something1,something2)) then the solution no > longer works, and I get an ellipse. > > A minimal example showing the breaking behavior can be seen below. > > > I am probably gonna reply to that stackoverflow question with a better > response... > > Essentially, you want a similar behavior to the markers in the scatter > plots, right? As you zoom or resize the plot, the circle markers stay > as circles and have the same size relative to the size of the figure. > If that is what you want, the way to do that is very easy. > > ax1.scatter([0.5], [0.5], s=30) > > Or whatever size you want (units of points). I think the units are points^2, i.e., area of the circle... Thanks, Jason |