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
=
(),
)
ax
=
(
rect
,
axes_class
=
,
grid_helper
=
grid_helper
,
aspect
=
1
,
xlim
=
(
-
5
,
12
),
ylim
=
(
-
5
,
10
))
ax
.
[:]
.
set_visible
(
False
)
return
ax
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
=
(
9
,
3.
))
(
left
=
0.01
,
right
=
0.99
,
bottom
=
0.01
,
top
=
0.99
,
wspace
=
0.01
,
hspace
=
0.01
)
def
ann
(
,
d
):
(
d
,
(
0.5
,
1
),
(
5
,
-
5
),
xycoords
=
"axes fraction"
,
textcoords
=
"offset points"
,
va
=
"top"
,
ha
=
"center"
)
=
setup_axes
(
,
rect
=
231
)
=
add_floating_axis1
(
)
ann
(
,
"default"
)
=
setup_axes
(
,
rect
=
232
)
=
add_floating_axis1
(
)
(
10
)
ann
(
,
"ticklabels.set_pad(10)"
)
=
setup_axes
(
,
rect
=
233
)
=
add_floating_axis1
(
)
(
20
)
ann
(
,
"label.set_pad(20)"
)
=
setup_axes
(
,
rect
=
234
)
=
add_floating_axis1
(
)
(
"in"
)
ann
(
,
'ticks.set_tick_direction("in")'
)
=
setup_axes
(
,
rect
=
235
)
=
add_floating_axis1
(
)
(
"out"
)
ann
(
,
'ticks.set_tick_direction("out")'
)
=
setup_axes
(
,
rect
=
236
)
=
add_floating_axis1
(
)
(
"inout"
)
ann
(
,
'ticks.set_tick_direction("inout")'
)
()