Skip to content

Commit

Permalink
fix ylim bug in plot_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
trichter committed Feb 20, 2025
1 parent b484f87 commit 2244984
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rf/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def plot_profile(profile, fname=None, figsize=None, dpi=None,
phase = profile[0].stats.moveout
slowness = profile[0].stats.slowness
pd = model.calculate_delay_times(phase=phase, slowness=slowness)
ylim = ax.get_ylim()
ax2 = ax.twinx()
ax.sharey(ax2)
dkm = 50
Expand All @@ -355,7 +356,7 @@ def plot_profile(profile, fname=None, figsize=None, dpi=None,
ax2.yaxis.set_minor_locator(myMinorLocator)
ax2.yaxis.set_major_formatter(myFormatter)
ax2.set_ylabel('depth (km)')
ax2.set_ylim(ax.get_ylim())
ax2.set_ylim(ylim)
if top is not None:
ax3 = fig.add_axes([0.1, 0.85, 0.8, 0.1], sharex=ax)
if top == 'hist':
Expand Down

0 comments on commit 2244984

Please sign in to comment.