Skip to content

Commit

Permalink
MNT: Eliminate some unnecessary uses of pyplot
Browse files Browse the repository at this point in the history
This specifically fixes a problem between matplotlib 3.0 and CartoPy.
  • Loading branch information
dopplershift committed Sep 27, 2018
1 parent 7da3aaa commit 27704d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/cross_section.py
Expand Up @@ -89,8 +89,8 @@
# Plot potential temperature using contour, with some custom labeling
theta_contour = ax.contour(cross['lon'], cross['isobaric'], cross['Potential_temperature'],
levels=np.arange(250, 450, 5), colors='k', linewidths=2)
plt.clabel(theta_contour, theta_contour.levels[1::2], fontsize=8, colors='k', inline=1,
inline_spacing=8, fmt='%i', rightside_up=True, use_clabeltext=True, alpha=0.6)
theta_contour.clabel(theta_contour.levels[1::2], fontsize=8, colors='k', inline=1,
inline_spacing=8, fmt='%i', rightside_up=True, use_clabeltext=True)

# Plot winds using the axes interface directly, with some custom indexing to make the barbs
# less crowded
Expand All @@ -104,7 +104,7 @@
ax.set_yscale('symlog')
ax.set_yticklabels(np.arange(1000, 50, -100))
ax.set_ylim(cross['isobaric'].max(), cross['isobaric'].min())
plt.yticks(np.arange(1000, 50, -100))
ax.set_yticks(np.arange(1000, 50, -100))

# Define the CRS and inset axes
data_crs = data['Geopotential_height'].metpy.cartopy_crs
Expand Down

0 comments on commit 27704d1

Please sign in to comment.