MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_polar_theta_limits

Function test_polar_theta_limits

lib/matplotlib/tests/test_polar.py:236–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234
235@image_comparison(['polar_theta_wedge.png'], style='default')
236def test_polar_theta_limits():
237 r = np.arange(0, 3.0, 0.01)
238 theta = 2*np.pi*r
239
240 theta_mins = np.arange(15.0, 361.0, 90.0)
241 theta_maxs = np.arange(50.0, 361.0, 90.0)
242 DIRECTIONS = ('out', 'in', 'inout')
243
244 fig, axs = plt.subplots(len(theta_mins), len(theta_maxs),
245 subplot_kw={'polar': True},
246 figsize=(8, 6))
247
248 for i, start in enumerate(theta_mins):
249 for j, end in enumerate(theta_maxs):
250 ax = axs[i, j]
251 ax.plot(theta, r)
252 if start < end:
253 ax.set_thetamin(start)
254 ax.set_thetamax(end)
255 else:
256 # Plot with clockwise orientation instead.
257 ax.set_thetamin(end)
258 ax.set_thetamax(start)
259 ax.set_theta_direction('clockwise')
260 ax.tick_params(tick1On=True, tick2On=True,
261 direction=DIRECTIONS[i % len(DIRECTIONS)],
262 rotation='auto')
263 ax.yaxis.set_tick_params(label2On=True, rotation='auto')
264 ax.xaxis.get_major_locator().base.set_params( # backcompat
265 steps=[1, 2, 2.5, 5, 10])
266
267
268@check_figures_equal()

Callers

nothing calls this directly

Calls 9

set_thetaminMethod · 0.80
set_thetamaxMethod · 0.80
set_theta_directionMethod · 0.80
set_tick_paramsMethod · 0.80
get_major_locatorMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
tick_paramsMethod · 0.45
set_paramsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…