Skip to content

Commit 908160f

Browse files
committed
rebase fixes
1 parent b9cd362 commit 908160f

3 files changed

Lines changed: 23 additions & 19 deletions

File tree

src/metpy/plots/declarative.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,20 @@ class PanelTraits(MetPyHasTraits):
203203
'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'.
204204
"""
205205

206+
left_title = Unicode(allow_none=True, default_value=None)
207+
left_title.__doc__ = """A string to set a title for the figure with the location on the
208+
top left of the figure.
209+
210+
This trait sets a user-defined title that will plot at the top left of the figure.
211+
"""
212+
213+
right_title = Unicode(allow_none=True, default_value=None)
214+
right_title.__doc__ = """A string to set a title for the figure with the location on the
215+
top right of the figure.
216+
217+
This trait sets a user-defined title that will plot at the top right of the figure.
218+
"""
219+
206220
plots = List(Any())
207221
plots.__doc__ = """A list of handles that represent the plots (e.g., `ContourPlot`,
208222
`FilledContourPlot`, `ImagePlot`, `SkewPlot`) to put on a given panel.

tests/plots/test_declarative.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from io import BytesIO
88
import warnings
99

10+
import matplotlib
1011
import matplotlib.pyplot as plt
1112
import numpy as np
1213
import pandas as pd
@@ -24,6 +25,8 @@
2425
from metpy.testing import get_upper_air_data, needs_cartopy
2526
from metpy.units import units
2627

28+
MPL_VERSION = matplotlib.__version__[:5]
29+
2730

2831
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.02)
2932
@needs_cartopy
@@ -2061,7 +2064,8 @@ def test_declarative_plot_geometry_points(ccrs):
20612064
return pc.figure
20622065

20632066

2064-
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.03)
2067+
@pytest.mark.mpl_image_compare(remove_text=True,
2068+
tolerance=3.27 if MPL_VERSION.startswith('3.3') else 0.03)
20652069
def test_declarative_skewt_plot():
20662070
"""Test plotting of a simple skewT with declarative."""
20672071
date = datetime(2016, 5, 22, 0)
@@ -2089,7 +2093,8 @@ def test_declarative_skewt_plot():
20892093
return panel.figure
20902094

20912095

2092-
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.03)
2096+
@pytest.mark.mpl_image_compare(remove_text=True,
2097+
tolerance=3.24 if MPL_VERSION.startswith('3.3') else 0.03)
20932098
def test_declarative_skewt_plot_shade_cape():
20942099
"""Test plotting of a skewT with declarative and shading."""
20952100
from metpy.calc import parcel_profile

tests/plots/test_skewt.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,8 @@ def test_skewt_api():
4747
return fig
4848

4949

50-
@pytest.mark.mpl_image_compare(remove_text=True, style='default', tolerance=0.069)
51-
def test_skewt_labeled_lines():
52-
"""Test the SkewT with the labeled plot lines function."""
53-
fig = plt.figure(figsize=(8.5, 11))
54-
skew = SkewT(fig, rotation=45)
55-
56-
# Set sensible axis limits
57-
skew.ax.set_ylim(1000, 100)
58-
skew.ax.set_xlim(-30, 50)
59-
60-
# Add the relevant special lines
61-
skew.plot_labeled_skewt_lines()
62-
63-
return fig
64-
65-
66-
@pytest.mark.mpl_image_compare(remove_text=True, style='default', tolerance=0.069)
50+
@pytest.mark.mpl_image_compare(remove_text=True, style='default',
51+
tolerance=1.99 if MPL_VERSION.startswith('3.3') else 0.069)
6752
def test_skewt_labeled_lines():
6853
"""Test the SkewT with the labeled plot lines function."""
6954
fig = plt.figure(figsize=(8.5, 11))

0 commit comments

Comments
 (0)