proplot icon indicating copy to clipboard operation
proplot copied to clipboard

Grid misplacement

Open Koni2020 opened this issue 1 year ago • 5 comments

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

Koni2020 avatar May 01 '24 07:05 Koni2020

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

syrte avatar May 01 '24 09:05 syrte

@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

Koni2020 avatar May 01 '24 15:05 Koni2020

Would you try this and see it solves the problem

axes.pcolormesh(ds, edgefix=False)

syrte avatar May 01 '24 16:05 syrte

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

Koni2020 avatar May 02 '24 04:05 Koni2020

I just discovered this problem as well (using ultraplot)! I opened an issue in ultraplot for it: https://github.com/Ultraplot/ultraplot/issues/136

Ockenfuss avatar Apr 03 '25 14:04 Ockenfuss