-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
Description
When I'm making hist2d or hexbin plots in proplot, I have an issue where in the hist2d the rectangles arent correctly shaped, specifically it seems the lowest pixel row, and when I use hexbin, some of the hexes appear to be smaller or below other hexes.
Proplot code:
import proplot as pplt
import numpy as np
import matplotlib.pyplot as plt
# Sample data
N = 500
state = np.random.RandomState(51423)
x = state.normal(size=(N,))
y = state.normal(size=(N,))
bins = pplt.arange(-3, 3, 0.25)
fig, axs = pplt.subplots(refaspect=1, width='50mm')
axs[0].hist2d(
x, y, bins, vmin=0, vmax=10,
cmap='Blues',
)Proplot result:
Zoom of the rectangles:
Matplotlib code:
import numpy as np
import matplotlib.pyplot as plt
# Sample data
N = 500
state = np.random.RandomState(51423)
x = state.normal(size=(N,))
y = state.normal(size=(N,))
bins = np.arange(-3, 3.2, 0.25)
fig, ax = plt.subplots()
ax.set_aspect(1)
ax.hist2d(x, y, bins, cmap='Blues', vmin=0, vmax=10)Matplotlib result
For the hist2d it isnt too bad, especially with high resolutions (since its appears only to be the lowest pixel line). pdf output has the same effect.
The hexbin looks like this:
Proplot:
...
axs[0].hexbin(
x, y, gridsize=20, vmin=0, vmax=10,
cmap='Blues',
)Matplotlib:
ax.hexbin(x, y, cmap='Blues', gridsize=20, vmin=0, vmax=10)Version info:
proplot==0.9.5
matplotlib==3.4.3
Using py39 on windows 11




