Skip to content

Commit

Permalink
Add new ax feature
Browse files Browse the repository at this point in the history
  • Loading branch information
FloraSauerbronn committed Jun 12, 2024
1 parent 80f6759 commit c8d673a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gliderpy/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def plot_track(df: pd.DataFrame) -> tuple(plt.Figure, plt.Axes):
def plot_transect(
df: pd.DataFrame,
var: str,
ax: plt.Axes = None,
**kw: dict,
) -> tuple(plt.Figure, plt.Axes):
"""Make a scatter plot of depth vs time coloured by a user defined
Expand All @@ -56,7 +57,11 @@ def plot_transect(
"""
cmap = kw.get("cmap", None)

fig, ax = plt.subplots(figsize=(17, 2))
if ax is None:
fig, ax = plt.subplots(figsize=(17, 2))
else:
fig = ax.figure

cs = ax.scatter(
df.index,
df["pressure"],
Expand Down

0 comments on commit c8d673a

Please sign in to comment.