(fig_test, fig_ref)
| 130 | |
| 131 | @check_figures_equal() |
| 132 | def test_polar_units_2(fig_test, fig_ref): |
| 133 | import matplotlib.testing.jpl_units as units |
| 134 | units.register() |
| 135 | xs = [30.0, 45.0, 60.0, 90.0] |
| 136 | xs_deg = [x * units.deg for x in xs] |
| 137 | ys = [1.0, 2.0, 3.0, 4.0] |
| 138 | ys_km = [y * units.km for y in ys] |
| 139 | |
| 140 | plt.figure(fig_test) |
| 141 | # test {theta,r}units. |
| 142 | plt.polar(xs_deg, ys_km, thetaunits="rad", runits="km") |
| 143 | assert isinstance(plt.gca().xaxis.get_major_formatter(), |
| 144 | units.UnitDblFormatter) |
| 145 | |
| 146 | ax = fig_ref.add_subplot(projection="polar") |
| 147 | ax.plot(np.deg2rad(xs), ys) |
| 148 | ax.xaxis.set_major_formatter(mpl.ticker.FuncFormatter("{:.12}".format)) |
| 149 | ax.set(xlabel="rad", ylabel="km") |
| 150 | |
| 151 | |
| 152 | @image_comparison(['polar_rmin.png'], style='default') |
nothing calls this directly
no test coverage detected
searching dependent graphs…