|
@@ 180-195 (lines=16) @@
|
| 177 |
|
|
| 178 |
|
p = np.linspace(1000, 100, 10) |
| 179 |
|
u = np.linspace(-10, 10, 10) |
| 180 |
|
skew.plot_barbs(p, u, u, c=u) |
| 181 |
|
|
| 182 |
|
return fig |
| 183 |
|
|
| 184 |
|
|
| 185 |
|
@pytest.mark.mpl_image_compare(tolerance=0, remove_text=True) |
| 186 |
|
def test_hodograph_plot_layers(): |
| 187 |
|
"""Test hodograph colored height layers with interpolation.""" |
| 188 |
|
u = np.arange(5, 65, 5) * units('knot') |
| 189 |
|
v = np.arange(-5, -65, -5) * units('knot') |
| 190 |
|
h = [178, 213, 610, 656, 721, 914, 1060, |
| 191 |
|
1219, 1372, 1412, 1512, 1524] * units('meter') |
| 192 |
|
colors = ['red', 'green'] |
| 193 |
|
levels = [0, 500, 1000] * units('meter') |
| 194 |
|
fig = plt.figure(figsize=(9, 9)) |
| 195 |
|
ax = fig.add_subplot(1, 1, 1) |
| 196 |
|
hodo = Hodograph(ax, component_range=80) |
| 197 |
|
hodo.add_grid(increment=20, color='k') |
| 198 |
|
hodo.plot_colormapped(u, v, h, bounds=levels, colors=colors) |
|
@@ 198-212 (lines=15) @@
|
| 195 |
|
ax = fig.add_subplot(1, 1, 1) |
| 196 |
|
hodo = Hodograph(ax, component_range=80) |
| 197 |
|
hodo.add_grid(increment=20, color='k') |
| 198 |
|
hodo.plot_colormapped(u, v, h, bounds=levels, colors=colors) |
| 199 |
|
|
| 200 |
|
return fig |
| 201 |
|
|
| 202 |
|
|
| 203 |
|
@pytest.mark.mpl_image_compare(tolerance=0, remove_text=True) |
| 204 |
|
def test_hodograph_plot_layers_different_units(): |
| 205 |
|
"""Test hodograph colored height layers with interpolation and different units.""" |
| 206 |
|
u = np.arange(5, 65, 5) * units('knot') |
| 207 |
|
v = np.arange(-5, -65, -5) * units('knot') |
| 208 |
|
h = [178, 213, 610, 656, 721, 914, 1060, |
| 209 |
|
1219, 1372, 1412, 1512, 1524] * units('meter') |
| 210 |
|
colors = ['red', 'green'] |
| 211 |
|
levels = [0, 0.5, 1] * units.km |
| 212 |
|
fig = plt.figure(figsize=(9, 9)) |
| 213 |
|
ax = fig.add_subplot(1, 1, 1) |
| 214 |
|
hodo = Hodograph(ax, component_range=80) |
| 215 |
|
hodo.add_grid(increment=20, color='k') |