Skip to content

Commit

Permalink
Adjusting an existing ax and resolving the axis inversion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
FloraSauerbronn committed Jun 18, 2024
1 parent ebe0451 commit 6901b63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gliderpy/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def plot_transect(
ax = plt.gca()
fig = plt.gcf()

if not ax.yaxis_inverted():
ax.invert_yaxis()

cs = ax.scatter(
df.index,
df["pressure"],
Expand All @@ -76,7 +79,6 @@ def plot_transect(
cmap=cmap,
)

ax.invert_yaxis()
xfmt = mdates.DateFormatter("%H:%Mh\n%d-%b")
ax.xaxis.set_major_formatter(xfmt)

Expand Down

0 comments on commit 6901b63

Please sign in to comment.