You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if there is a possibility to display only a circular sector of a polar plot.
At the moment there is always plotted the full circle (360 degree).
So I suggest a thetamax and thetamin parameter for the polar plot.
Thanks!
Reacted by Joel Ostblom, Andrea Cimatoribus and Vladimir Ivonin
On a similar note , I constantly face this problem and method to solve would be appreciated.
and would like to have an extrapolation routine for theta domain.
As mentioned in the previous comment that At the moment matplotlib only plots the full circle (360 degree).
So if one has a theta domain from 0.01 to 2.0_pi-0.01 then it leaves white space (i.e. it does not complete the whole circle)
One usually encounters such domains in numerical grid as starting the value of theta from 0.0 could lead to singularities.
Is there any way to get rid of this white space by forcing the theta domain to start from 0.0 to 2.0_pi and extrapolating the associated 2D data on the polar axis?
I wonder how much work this would be to implement. It seems the set_xlim() and set_ylim() axes methods for polar plots are supposed to control theta and r limits respectively. set_ylim works as expected for r, though unfortunately set_xlim() doesn't seem to have any effect at all, unless I'm doing something wrong.
There's also a set_rlim() which seems to do the same as set_ylim(), and there are get_rmax and get_rmin methods, but strangely no get_rlim method.
So what's the actual way going forward here? Copying stuff from mpl_toolkit into the polar axes? (That code is ugly.)
The best result (from a user perspective) would be being able to set theta min/max on a regular polar axes. Using mpl_toolkit is already in the examples and not particularly nice.
Activity
coolastro commentedon Jan 16, 2012
On a similar note , I constantly face this problem and method to solve would be appreciated.
and would like to have an extrapolation routine for theta domain.
As mentioned in the previous comment that At the moment matplotlib only plots the full circle (360 degree).
So if one has a theta domain from 0.01 to 2.0_pi-0.01 then it leaves white space (i.e. it does not complete the whole circle)
One usually encounters such domains in numerical grid as starting the value of theta from 0.0 could lead to singularities.
Is there any way to get rid of this white space by forcing the theta domain to start from 0.0 to 2.0_pi and extrapolating the associated 2D data on the polar axis?
mspacek commentedon Dec 14, 2013
I wonder how much work this would be to implement. It seems the
set_xlim()andset_ylim()axes methods for polar plots are supposed to control theta and r limits respectively.set_ylimworks as expected for r, though unfortunatelyset_xlim()doesn't seem to have any effect at all, unless I'm doing something wrong.There's also a
set_rlim()which seems to do the same asset_ylim(), and there areget_rmaxandget_rminmethods, but strangely noget_rlimmethod.Seems example 2 and 3 in this demo show a way forward for doing less than a full 360 deg polar plot, and also for creating an annulus. Looks a bit complicated though:
http://matplotlib.org/mpl_toolkits/axes_grid/users/overview.html#floating-axes
Some discussion from 2008:
http://comments.gmane.org/gmane.comp.python.matplotlib.general/14711
mspacek commentedon Dec 17, 2013
I hacked together something that works well enough for me, based on the floating-axes demo from mpl_toolkits. Here's the code:
https://github.com/neuropy/neuropy/blob/master/neuropy/scripts/polar_demo.py
And a couple of example plots:
tacaswell commentedon Aug 18, 2014
@mspacek Would you be willing to put that into a PR?
Maybe this belongs in mpl_toolkit.
drrossum commentedon Sep 8, 2014
+1
I would be very interested in this feature too. Will use mspacek's routine for now
QuLogic commentedon Jul 14, 2015
So what's the actual way going forward here? Copying stuff from mpl_toolkit into the polar axes? (That code is ugly.)
The best result (from a user perspective) would be being able to set theta min/max on a regular polar axes. Using mpl_toolkit is already in the examples and not particularly nice.
mspacek commentedon Jul 14, 2015
I agree, I think it would be best to make this a feature of
pylab.polar(). Even when I wrote it, I didn't understand some of the code inhttps://github.com/neuropy/neuropy/blob/master/neuropy/scripts/polar_demo.py
which itself was mostly copied from mpl_toolkits:
http://matplotlib.org/mpl_toolkits/axes_grid/users/overview.html#floating-axes
I just got it to work through trial and error. So, I'm not sure I'm qualified to merge this into
pyplot.polar().caichao commentedon Jan 11, 2017
wonderful works. @mspacek