I am using pcolormesh to create a heatmap.
heatmap = plt.pcolormesh(
grid,
edgecolors="k",
cmap=colors.ListedColormap(
[
"white",
"red",
"blue",
"green",
"orange",
"black",
"purple",
"yellow",
"brown",
"violet",
"gray",
]
),
linewidth=2,
)
ax = plt.gca()
ax.set_aspect("auto")
I want to set the cells shape to be rectangular. How can I do that?