Affine2D
import
mpl_toolkits.axisartist
as
axisartist
from
mpl_toolkits.axisartist
import
angle_helper
,
grid_finder
from
mpl_toolkits.axisartist.grid_helper_curvelinear
import
def
setup_axes
(
,
rect
):
"""Polar projection, but in a rectangular box."""
grid_helper
=
(
()
.
scale
(
/
180.
,
1.
)
+
(),
extreme_finder
=
(
20
,
20
,
lon_cycle
=
360
,
lat_cycle
=
None
,
lon_minmax
=
None
,
lat_minmax
=
(
0
,
),
),
grid_locator1
=
(
12
),
grid_locator2
=
(
5
),
tick_formatter1
=
(),
)
=
(
rect
,
axes_class
=
,
grid_helper
=
grid_helper
,
aspect
=
1
,
xlim
=
(
-
5
,
12
),
ylim
=
(
-
5
,
10
))
[:]
.
toggle
(
ticklabels
=
False
)
(
color
=
".9"
)
return
def
add_floating_axis1
(
):
[
"lat"
]
=
=
(
0
,
30
)
(
r
"$\theta = 30^{\circ}$"
)
(
True
)
return
def
add_floating_axis2
(
):
[
"lon"
]
=
=
(
1
,
6
)
(
r
"$r = 6$"
)
(
True
)
return
=
(
figsize
=
(
8
,
4
),
layout
=
"constrained"
)
for
,
in
enumerate
([
"bottom"
,
"left"
,
"top"
,
"right"
]):
=
setup_axes
(
,
rect
=
241
+
)
=
add_floating_axis1
(
)
(
)
(
title
=
)
for
,
in
enumerate
([
"bottom"
,
"left"
,
"top"
,
"right"
]):
=
setup_axes
(
,
rect
=
245
+
)
=
add_floating_axis2
(
)
(
)
(
title
=
)
()
Total running time of the script: (0 minutes 1.739 seconds)