Inset_axes in polar coordinates
Question:
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
..
Answers:
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')
.
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.
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
..
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')
.
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.