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

Grid misplacement #455

Open
Koni2020 opened this issue May 1, 2024 · 4 comments
Open

Grid misplacement #455

Koni2020 opened this issue May 1, 2024 · 4 comments

Comments

@Koni2020
Copy link

Koni2020 commented May 1, 2024

Description

In some cases, I find that the grid plotted by the pcolormesh function exhibits misplacement at the bottom (as shown in the following figure). However, it only occurs when a large matrix (e. g. 50 x 50 matrix) is used. If a small matrix is used, it performs correctly. Is this a bug? How to fix it?

1714547981163

Code

import numpy as np
import proplot as pplt


ds = np.random.random([50, 50])
fig, axes = pplt.subplots(nrows=1, ncols=1)
axes.pcolormesh(ds)
fig.save('test.png')

Proplot version

matplotlib 3.4.3
proplot 0.9.7

@syrte
Copy link

syrte commented May 1, 2024

do you get similar problem with matplotlib (without importing proplot)? it could be problem from upstream.

@Koni2020
Copy link
Author

Koni2020 commented May 1, 2024

@syrte The matplotlib pcolor function performs correctly. So, what's the upstream?

Code

import numpy as np
import matplotlib.pyplot as plt


ds = np.random.random([50, 50])
plt.pcolor(ds)
plt.savefig('test.png')

Result

test

@syrte
Copy link

syrte commented May 1, 2024

Would you try this and see it solves the problem

axes.pcolormesh(ds, edgefix=False)

@Koni2020
Copy link
Author

Koni2020 commented May 2, 2024

@syrte Thanks for your help. The problem have been solved by passing edgefix=Fasle into the pcolor function.

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

2 participants