8000 Purpose of Scatter plot with pie-chart markers example · Issue #14055 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Purpose of Scatter plot with pie-chart markers example #14055

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
timhoffm opened this issue Apr 26, 2019 · 3 comments
Closed

Purpose of Scatter plot with pie-chart markers example #14055

timhoffm opened this issue Apr 26, 2019 · 3 comments
Milestone

Comments

@timhoffm
Copy link
Member

I would like to improve this example:

https://matplotlib.org/devdocs/gallery/lines_bars_and_markers/scatter_piecharts.html

But I'm actually unclear, what the key message is:

  • Should additional information be encoded in the pies? If so, one should have different pies at different points. This would require individual markers xy* per point.
  • Or is this only a way to illustrate how to create fancy multicolored markers? In that case, I'd probably not adapt the size and resort to plot() instead of scatter() to keep it more simple.
@ImportanceOfBeingErnest
Copy link
Member
ImportanceOfBeingErnest commented Apr 30, 2019

I've definitely seen people asking how to use their own data for those pie charts and then finding it utterly complicated to produce one single marker per wedge. It would probably help to start with some 3 rows by 3 column (1 column per pie) dataset and use functions to simplify the creation of those markers.

Peronally, I think when attempting such pie chart scatter, I would always either opt for creating a pie inside an inset axes

mpl_toolkits.axes_grid1.inset_locator.inset_axes(..., 
                bbox_to_anchor=(x-radius, y-radius, radius*2, radius*2),
                bbox_transform=ax.transData, loc="center")

or creating the wedges from scratch inside a DrawingArea.

One thing that makes the example unnecessarily complicated if using truely different ratios is the fact that markers are always normalized

rescale = max(np.max(np.abs(verts[:, 0])),
np.max(np.abs(verts[:, 1])))
self._transform = Affine2D().scale(0.5 / rescale)

so an option to turn this behaviour off might also simplify the example a lot.

@oscargus
Copy link
Member

The pie-chart marker example does no longer exist. Should this be closed or renamed?

(It seems like being able to create a scatter with custom pie charts may still be quite useful?)

@timhoffm
Copy link
Member Author

The pie chart symbol example was removed in #22276. As it was, it was not very useful, because all points had the same pie distribution.

@QuLogic QuLogic added this to the v3.6.0 milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0