Skip to content

Commit

Permalink
Add test of fontsize change
Browse files Browse the repository at this point in the history
  • Loading branch information
jrleeman committed Feb 8, 2017
1 parent 53d5166 commit 5d01bc0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions metpy/plots/tests/test_station_plot.py
Expand Up @@ -199,6 +199,28 @@ def test_nws_layout():
return fig


@pytest.mark.mpl_image_compare(tolerance={'1.5': 0.1474, '1.4': 7.02}.get(MPL_VERSION, 0.0113),
savefig_kwargs={'dpi': 300}, remove_text=False)
def test_plot_text_fontsize():
"""Test changing fontsize in plot_text."""
fig = plt.figure(figsize=(3, 3))
ax = plt.subplot(1, 1, 1)

# testing data
x = np.array([1])
y = np.array([2])

# Make the plot
sp = StationPlot(ax, x, y, fontsize=36)
sp.plot_text('NW', ['72'], fontsize=24)
sp.plot_text('SW', ['60'], fontsize=4)

sp.ax.set_xlim(0, 3)
sp.ax.set_ylim(0, 3)

return fig


def test_layout_str():
"""Test layout string representation."""
layout = StationPlotLayout()
Expand Down

0 comments on commit 5d01bc0

Please sign in to comment.