0

I am using matplotlib.axes.Axes.inset_axes (https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.inset_axes.html) to create an child axe of a an existing parent axe.

How do I set it to polar coordinates ? I can not use this: Matplotlib inset polar plot as 'Axes' object has no property 'polar'.

But inset_axes only returns Axes objects and not projections.polar.PolarAxes ..

Liris
  • 1,399
  • 3
  • 11
  • 29
  • 1
    Here are two other questions to consider: [this one](https://stackoverflow.com/questions/53204267/matplotlib-figure-add-axes-convert-from-x-y-to-relative-coordinates/53210818#53210818) and [this one](https://stackoverflow.com/questions/46262749/plotting-scatter-of-several-polar-plots/46263911#46263911). Both use polar plots on inset axes. – ImportanceOfBeingErnest Oct 28 '19 at 18:47

2 Answers2

1

From the comment of ImportanceOfBeingErnest:

just use mpl_toolkits.axes_grid1.inset_locator.inset_axes() instead, with the parameter axes_class = matplotlib.projections.get_projection_class('polar').

Liris
  • 1,399
  • 3
  • 11
  • 29
0

From version 3.6, matplotlib.axes.Axes.inset_axes also accepts "polar" and "projection" parameters, so the original version of your code will work in the latest versions.

hrgu
  • 11
  • 3
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/33086489) – GAVD Nov 07 '22 at 06:52