Skip to content

Commit

Permalink
Fix lower bounds for x and y axes
Browse files Browse the repository at this point in the history
Sets lower bounds for x and y axes to -1 so we can see boxplots at x=0
and leaves the upper bounds to matplotlib to calculate more nicely.
  • Loading branch information
huddlej committed Mar 21, 2024
1 parent 20cdf01 commit dead5be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pathogen_embed/pathogen_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ def embed(args):
ax.yaxis.set_major_formatter(distance_tick_formatter)
ax.yaxis.set_major_locator(MultipleLocator(5))

ax.set_xlim(genetic_distances.min(), genetic_distances.max())
ax.set_ylim(bottom=0)
ax.set_xlim(left=-1)
ax.set_ylim(bottom=-1)

ax.set_title(f"{args.command} (Pearson's $R^2={r_value:.2f}, y = {slope:.2f}x {intercept_sign} {np.abs(intercept):.2f}$)")
plt.tight_layout()
Expand Down

0 comments on commit dead5be

Please sign in to comment.