Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Display r and theta on hover for polar plots#26271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thank you for your interest in contributing to Matplotilb, however this PR does not address the issue in#4568 . The core issue is that for Cartesian plots there are functions you can set to control how the mouse over reports (seehttps://matplotlib.org/stable/gallery/misc/coords_report.html for the updated version of the docs, you will need to use an interactive backend (not matplotlib-inline in a notebook) to see it do anything) the x and y values. The issue reports that those functions are ignored on polar axes (see matplotlib/lib/matplotlib/axes/_base.py Lines 3905 to 3910 inb274f78
matplotlib/lib/matplotlib/projections/polar.py Lines 1396 to 1425 inb274f78
The proposed fixes are to do one of the following:
See the discussion in the issue for pros and cons of each. The rough consensus seemed to be towards the second option. |
I am unusre if my solution is of any help as it was not clear to me if the goal was to leave a possibe example or make a standarization to solve an underlying issue. i did however manage to get the example code working with the bits that were asked for. |
so the issue is that interactive ploting features are ignored when the plot is polar? and the goal of the issue is to modify the code above to make it so that these interactive plotting functions are not ignored? |
This modification uses the fmt_xdata and fmt_ydata methods by retrieving the corresponding formatters (fmt_theta and fmt_r) from the x-axis and y-axis, respectively, to format the theta and r values in the format_coord method.
is the change I made better? |
@klorine28 ive not followed the suggestion here fully. However this is not in the form of either an example (galleries/examples) or what I think was being asked for, which is a modification to the polar axes that would display r and theta by default. |
I apologise for this is my first interaction with open source that is not documentation. So what I am trying to do is modify the format coords so that r and theta are displayed by default? What I understood from the issue was that in cartesian plots, you can see the info of a point by interacting with it, but this is ignored in polar plots. As such, the solution would be to make it so that when you hover over a point in a polar plot, it displays theta and r. Is that correct? |
any coment on my question? is the second commit what is wanted? |
Hi@klorine28 - you may get more attention here if you rename your PR to something more descriptive, for example something like "Display r and theta on hover for polar plots" (please choose the wording that makes more sense to you). In addition, you can then add "Closes#4568" to the description of your PR to make sure it is linked to the original issue here in the GitHub web interface. Beyond that, there are also a couple of Linting errors that you can fix while you wait for a review:https://github.com/matplotlib/matplotlib/actions/runs/5486484810/job/14858128627?pr=26271 Thanks! |
Uh oh!
There was an error while loading.Please reload this page.
PR summary
PR checklist
fmt_r
andfmt_theta
methods to polar axes #4568" is in the body of the PR description tolink the related issue