Skip to content

thetamin/-max for polar plot  #328

Closed

Description

@ddale

Original report at SourceForge, opened Sun Jun 15 16:58:00 2008

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!

Activity

  1. coolastro commented on Jan 16, 2012

    @coolastro

    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?

  2. ghost assigned on Oct 18, 2012
  3. mspacek commented on Dec 14, 2013

    @mspacek
    Contributor

    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.

    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

  4. mspacek commented on Dec 17, 2013

    @mspacek
    Contributor

    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:

    figure_1
    figure_2

  5. added this to the milestone on Aug 18, 2014
  6. tacaswell commented on Aug 18, 2014

    @tacaswell
    Member

    @mspacek Would you be willing to put that into a PR?

    Maybe this belongs in mpl_toolkit.

  7. drrossum commented on Sep 8, 2014

    @drrossum

    +1
    I would be very interested in this feature too. Will use mspacek's routine for now

  8. QuLogic commented on Jul 14, 2015

    @QuLogic
    Member

    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.

  9. mspacek commented on Jul 14, 2015

    @mspacek
    Contributor

    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 in

    https://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().

  10. self-assigned this
    on Nov 15, 2016
  11. caichao commented on Jan 11, 2017

    @caichao

    wonderful works. @mspacek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions