Skip to content

Commit

Permalink
positive pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
FloraSauerbronn committed Jul 28, 2024
1 parent 4edd36d commit 9232e5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gliderpy/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,16 @@ def plot_ctd(

if ax is None:
fig, ax1 = plt.subplots(figsize=(5, 6))
ax1.plot(profile[var], -profile["pressure"], label=var, color=color)
ax1.plot(profile[var], profile["pressure"], label=var, color=color)
ax1.set_ylabel("Pressure")
ax1.set_xlabel(var)
ax1.legend()
ax1.invert_yaxis()
return fig, ax1

fig = ax.get_figure()
ax2 = ax.twiny() # Create a new twinned axis
ax2.plot(profile[var], -profile["pressure"], label=var, color=color)
ax2.plot(profile[var], profile["pressure"], label=var, color=color)
ax2.set_xlabel(var)

# Handle legends
Expand Down

0 comments on commit 9232e5c

Please sign in to comment.