Skip to content

API question with polar plotting versus Radar chart #10561

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from

Conversation

x-meowzilla
Copy link

PR Summary

Fixed polygon not correctly filled in polar plot #9261
Override fill() method in PolarAxes class, where the filling polygon should have straight edges in polar axis instead of curved edges, the _interpolation_step field should not be changed for these filling polygons.

This PR includes the changes from #10488.

The radar chart should produce the output as expected.
radar_chart_expected

@jklymak jklymak changed the title Bug Fix - Radar chart broken in 2.1 (#9261) Bug Fix - Radar chart broken in 2.1 Feb 22, 2018
@x-meowzilla
Copy link
Author

x-meowzilla commented Feb 22, 2018

I have not yet push the image comparison test,
For some reason, the test always produce a RMS of 4.77

@image_comparison(baseline_images=['polar_polygon_filling'], extensions=['png'],
                  style='mpl20', remove_text=True)
def test_polar_polygon_filling():
    x = np.linspace(0, np.pi, 5)
    y = np.abs(np.sin(x))
    fig = plt.figure(figsize=(6.4, 4.8))
    ax = fig.add_subplot(1, 1, 1, polar=True)
    # ax.set_rmax(1.5)
    ax.plot(x, y)

Is there any ways to improve the accuracy?

@jklymak
Copy link
Member

jklymak commented Feb 22, 2018

Sorry so we should close the other PR, right?

@x-meowzilla
Copy link
Author

If the output is correct, then we can close the other PR.
Thanks.

@QuLogic
Copy link
Member

QuLogic commented Feb 22, 2018

I don't think so; there's nothing wrong with the radar chart in current code. It's only if you apply the other PR that the problem occurs.

@efiring
Copy link
Member

efiring commented Mar 5, 2018

My impression is that the fundamental problem is with our API, and none of the related PRs fix that. For non-Cartesian coordinates, one should be able to specify the interpolation policy in a kwarg for each artist, and there should be a consistent and sensible default--presumably the one from rcParams. Then the radar example would simply specify 'interpolation_steps=1, or maybe "connection='straight'" (versus 'curved') for each patch. Or maybe it is a matter of interpolation in "data_space" versus "screen_space".

Cartopy handles this sort of thing, doesn't it?

@efiring efiring changed the title Bug Fix - Radar chart broken in 2.1 Radar chart broken in 2.1 Mar 5, 2018
@efiring efiring changed the title Radar chart broken in 2.1 API question with polar plotting versus Radar chart Mar 5, 2018
@efiring
Copy link
Member

efiring commented Mar 5, 2018

I changed the title because it was misleading; based on @QuLogic's comment, there was no breakage.

@jklymak
Copy link
Member

jklymak commented Mar 24, 2021

Feel free to re-open if this is still a going concern, but from the above it looks like this is not needed?

@jklymak jklymak closed this Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants