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
For polar axes, set_xlim and set_ylim behave completely differently than on rectangular coordinate systems. One unfortunate consequence of this is that panning and zooming on polar plots doesn't really make much sense.
When I figured out this was an issue, I set out to try to create my own callbacks to add zooming functionality to my application. As it turns out, the inability of polar axes to support zooming goes quite a bit deeper.
It would be really nice if the polar axes had zoom and pan tools that do what you intuitively expect -- e.g. treating the x and y coordinates as though they belonged a rectangular axis with polar data. This would be extremely helpful for the application I am building which relies partly on displaying very large polar plots that the user needs to be able to zoom in to see what is going on and read text. It might be so important that I will hack it myself, I'm not sure.
Firstly, thanks @aestrivex - it's something which has bothered me in the past too.
I'm not sure how embedded this limitation is into Polar and hence I am concerned as to whether you will be able to achieve this functionality without breaking backwards compatibility on several fronts. I'd encourage you to play with this though.
Something which you will find useful is to look at a cartopy plot which implements this kind of functionality for its map plots. If you have a linux based machine I'd have a look at that to see what is going on. Example code to see the plot, and then zoom/pan with it:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy
ax = plt.axes(projection=ccrs.Stereographic())
ax.add_feature(cartopy.feature.LAND)
ax.add_feature(cartopy.feature.OCEAN)
ax.add_feature(cartopy.feature.COASTLINE)
ax.gridlines()
plt.show()
If you want to talk through what's going on, feel free to use the mpl-dev mailing list and prefix the subject with "Cartopy: ". I'll be away for a week as of tomorrow, but I'll be able to help when I get back.
I think they are not very useful. In my opinion, when a projection is used, zooming and panning should work in the Cartesian display space (with the aspect ratio held constant), not in the r, theta coordinates, for example. I doubt anyone has actually found radial panning to be particularly helpful, and what it does accomplish could be done equally well by a more general zoom and pan. Similarly, there is no reason why one should not be able to do a zoom to rect on a polar or other projection. The hard part is figuring out how to handle grid lines and tick labels.
When I looked at this previously (I am not very familiar with the matplotlib codebase and was even less so a year ago), there appeared to be no real way to do what I wanted. From my pretty inexact understanding, polar axes are a type of 2Daxes (not anything like 3Daxes afaik) in which the x-values are actually theta-values, y-values are actually r-values and in many places in the code transformations are provided to do the right thing. The flow of execution is very complicated and because I didn't know what I was doing I came away with the conclusion that in order to implement the right thing, it would be easier to start from scratch with a new projection type (which is probably not correct).
If we can implement something that works, though, I'd use it.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment
Leaving a comment :)
I've found polar plots to be super useful in exploring LLM embeddings. While I understand that this might be a sort of niche thing, I'd still like enter into the record that even in 2024 there still exists an (albeit itinerant) interest in this feature.
The unfortunate reality though is that it's so much easier nowadays for everyone to roll their own than to contribute to this amazing lib. :(
The unfortunate reality though is that it's so much easier nowadays for everyone to roll their own than to contribute to this amazing lib.
Can you please say more about why you feel this way? Not cause I think you're wrong, but cause I'm interested in what we can do to make contributing easier. And you can reach out privately on any of our comms channels if there are things you're not comfortable saying in public.
The unfortunate reality though is that it's so much easier nowadays for everyone to roll their own than to contribute to this amazing lib.
Can you please say more about why you feel this way? Not cause I think you're wrong, but cause I'm interested in what we can do to make contributing easier.
As for this issue, I'll put it on the call and see if folks can unpack what's the difficulty with it.
Activity
pelson commentedon Jan 25, 2013
Firstly, thanks @aestrivex - it's something which has bothered me in the past too.
I'm not sure how embedded this limitation is into Polar and hence I am concerned as to whether you will be able to achieve this functionality without breaking backwards compatibility on several fronts. I'd encourage you to play with this though.
Something which you will find useful is to look at a cartopy plot which implements this kind of functionality for its map plots. If you have a linux based machine I'd have a look at that to see what is going on. Example code to see the plot, and then zoom/pan with it:
If you want to talk through what's going on, feel free to use the mpl-dev mailing list and prefix the subject with "Cartopy: ". I'll be away for a week as of tomorrow, but I'll be able to help when I get back.
Cheers,
fariza commentedon May 5, 2014
@pelson @aestrivex
A little bit late (a year is little right?)
For the MEP22 I have been playing with the Axes3D zoom and pan actions.
Polar is not 3D but is similar in that they both require special treatment.
With the
Navigationclass and theToolsclasses I have tried to address the problem of untangling theToolbarfrom the actions (PR #2759).I was looking at the code, but the pyplot stuff is too much of a mess for me to understand clearly what a polar Axes is.
Axes?AxeslikeAxes3D?If you could point me in the right direction, I can modify the
ZoomandPantools to work with polar plots.fariza commentedon May 5, 2014
Ups...
After hitting
CommentI found the polar implementation ofstart_pan,end_pananddrag_pan.It didn't work for me on the examples, because I was trying with the
Panand button 1, it only works onPanand button 3.efiring commentedon May 6, 2014
I think they are not very useful. In my opinion, when a projection is used, zooming and panning should work in the Cartesian display space (with the aspect ratio held constant), not in the r, theta coordinates, for example. I doubt anyone has actually found radial panning to be particularly helpful, and what it does accomplish could be done equally well by a more general zoom and pan. Similarly, there is no reason why one should not be able to do a zoom to rect on a polar or other projection. The hard part is figuring out how to handle grid lines and tick labels.
aestrivex commentedon May 6, 2014
When I looked at this previously (I am not very familiar with the matplotlib codebase and was even less so a year ago), there appeared to be no real way to do what I wanted. From my pretty inexact understanding, polar axes are a type of 2Daxes (not anything like 3Daxes afaik) in which the x-values are actually theta-values, y-values are actually r-values and in many places in the code transformations are provided to do the right thing. The flow of execution is very complicated and because I didn't know what I was doing I came away with the conclusion that in order to implement the right thing, it would be easier to start from scratch with a new projection type (which is probably not correct).
If we can implement something that works, though, I'd use it.
erkantan commentedon Apr 24, 2020
Is there any development for the feature? or another solution? @tacaswell @story645
github-actions commentedon Feb 28, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
emdiet commentedon May 8, 2024
Leaving a comment :)
I've found polar plots to be super useful in exploring LLM embeddings. While I understand that this might be a sort of niche thing, I'd still like enter into the record that even in 2024 there still exists an (albeit itinerant) interest in this feature.
The unfortunate reality though is that it's so much easier nowadays for everyone to roll their own than to contribute to this amazing lib. :(
story645 commentedon May 8, 2024
Can you please say more about why you feel this way? Not cause I think you're wrong, but cause I'm interested in what we can do to make contributing easier. And you can reach out privately on any of our comms channels if there are things you're not comfortable saying in public.
story645 commentedon May 8, 2024
Can you please say more about why you feel this way? Not cause I think you're wrong, but cause I'm interested in what we can do to make contributing easier.
As for this issue, I'll put it on the call and see if folks can unpack what's the difficulty with it.
asmwarrior commentedon Aug 1, 2024
This is the related discussion about how to pan or zoom in the polar axis, there are several workaround methods, see the answers in that post:
https://stackoverflow.com/questions/78819087/how-to-use-mouse-left-button-drag-to-pan-on-matplotlibs-polar-coordinate-axis/78819533#78819533