Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug when sharing x axis in subplots. #467

Open
reemagit opened this issue Oct 23, 2024 · 1 comment
Open

Possible bug when sharing x axis in subplots. #467

reemagit opened this issue Oct 23, 2024 · 1 comment

Comments

@reemagit
Copy link

Description

When I plot two subplots aligned as rows, the x is not really shared and there is a weird effect on the grid/xticks. Not sure if I'm doing something wrong, but it seems like a bug to me.

Steps to reproduce

fig,axs = pplt.subplots(nrows=2,ncols=1, sharex=True)
axs[0].scatter([0,10],[0,1])
axs[1].scatter([0,1],[0,1])

Expected behavior:

I would expect 2 plots, one on top of the other, with the x axis aligned so that I see 2 points on the very right on top, and two points on the very left in the bottom (see below for matplotlib output)

Actual behavior:

With proplot I get the following plot:

image

Equivalent steps in matplotlib

I can do something similar with matplotlib

fig = plt.figure()
ax1 = plt.subplot(211)
plt.scatter([0,10],[0,1])
plt.subplot(212, sharex = ax1)
plt.scatter([0,1],[0,1])

obtaining

image

Proplot version

matplotlib: 3.8.4
proplot: 0.9.91

@reemagit
Copy link
Author

This is probably the same issue as #465. Not sure if I should close it and post there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant