I realized a slight "misalignment" of a plot I'm making in 3D with matplotlib. Here is an MWE:
import numpy as np
from matplotlib import pyplot as plt
figure = plt.figure(figsize=(8,10.7))
ax = plt.gca(projection='3d')
ax.plot_surface(np.array([[0, 0], [30, 30]]),
np.array([[10, 10], [10, 10]]),
np.array([[10, 20], [10, 20]]),
rstride=1, cstride=1
)
ax.plot_surface(np.array([[0, 0], [30, 30]]),
np.array([[20, 20], [20, 20]]),
np.array([[10, 20], [10, 20]]),
rstride=1, cstride=1
)
plt.show()
plt.close()
Clearly, the bins are not correctly centered, as the surfaces seem to start at 10.5 and end at 20.5 instead of 10 and 20 sharply. How could one achieve the latter?
EDIT: I'm afraid that there is an issue with the suggested answer. The x-axis does not have a solid black line, as is the case by default:
When I take out the suggested wrapping, I get:
Unfortunately, when I take out the stuff that I'm plotting, this issue is not reproducible in a Jupyter notebook, but nevertheless, I was wondering about whether you might be able to point out to me what I'd have to do so that in my case, the x-axis has a black line again?



