Skip to content

Commit

Permalink
Fix func sig and defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
dcamron committed Jan 9, 2025
1 parent 27a49a3 commit c4edb47
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/metpy/plots/skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,16 +761,14 @@ class Stuve(SkewT):
"""

def __init__(self, *args, rotation=0, aspect='auto', **kwargs):
def __init__(self, fig=None, subplot=None, rect=None, aspect='auto'):
r"""Create Stüve plots.
Parameters
----------
fig : matplotlib.figure.Figure, optional
Source figure to use for plotting. If none is given, a new
:class:`matplotlib.figure.Figure` instance will be created.
rotation : float or int, optional
This value is ignored for Stuve plots, but included for compatibility with SkewT
subplot : tuple[int, int, int] or `matplotlib.gridspec.SubplotSpec` instance, optional
Controls the size/position of the created subplot. This allows creating
the skewT as part of a collection of subplots. If subplot is a tuple, it
Expand All @@ -787,7 +785,7 @@ def __init__(self, *args, rotation=0, aspect='auto', **kwargs):
the aspect ratio automatically.
"""
super().__init__(*args, **kwargs, rotation=0, aspect=aspect)
super().__init__(fig=fig, rotation=0, subplot=subplot, rect=rect, aspect=aspect)

# Forward (f) and inverse (g) functions for Stuve pressure coordinate scaling
def f(p):
Expand Down Expand Up @@ -817,16 +815,14 @@ class Emagram(SkewT):
"""

def __init__(self, *args, rotation=0, **kwargs):
def __init__(self, fig=None, subplot=None, rect=None, aspect='auto'):
r"""Create Emagram plots.
Parameters
----------
fig : matplotlib.figure.Figure, optional
Source figure to use for plotting. If none is given, a new
:class:`matplotlib.figure.Figure` instance will be created.
rotation : float or int, optional
This value is ignored for Emagrams, but included for compatibility with SkewT
subplot : tuple[int, int, int] or `matplotlib.gridspec.SubplotSpec` instance, optional
Controls the size/position of the created subplot. This allows creating
the skewT as part of a collection of subplots. If subplot is a tuple, it
Expand All @@ -839,11 +835,11 @@ def __init__(self, *args, rotation=0, **kwargs):
allows the user to place the axes at an arbitrary point on the figure.
aspect : float, int, or Literal['auto'], optional
Aspect ratio (i.e. ratio of y-scale to x-scale) to maintain in the plot.
Defaults to ``'auto'`` tells matplotlib to handle
Defaults to ``'auto'`` which tells matplotlib to handle
the aspect ratio automatically.
"""
super().__init__(*args, **kwargs, rotation=0)
super().__init__(fig=fig, rotation=0, subplot=subplot, rect=rect, aspect=aspect)


@exporter.export
Expand Down

0 comments on commit c4edb47

Please sign in to comment.