I am having a very similar issue to this post and this post, however I was not able to get the solution from the first post to work, and the second went unanswered. I would also like to avoid having to change the actual MatPlotLib libraries, as I am planning on sharing my code and want to be able to simply import the library unedited (the first post suggests changing the matplotlib library itself). My problem is that when making 3D plots in Matplotlib, I am finding that there is an invisible margin which begins to cut off my actual rendered data. This can be seen in the plot below, where the red data is clearly cut off on the right, and the magenta data is beginning to be cut off on the left):
Is it possible to extend these invisible margins? The actual axes on which the plot sits render correctly, but it is the data itself that begins to be cut off.
I have exhausted just about every StackOverflow post concerning this topic and have not been able to find anything that solves the problem. Here is some simple code which will recreate the problem I am having:
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
x_data = range(0,6)
y_Data = [10,10,10,10,10,10]
for i in range(6):
ax.bar(x_data, y_Data, zs=i, zdir='y', color="r", alpha=0.8)
ax.set_box_aspect((1,6,1))
ax.dist = 8
ax.elev = 23
ax.azim = 31
plt.show()