Reputation: 37
Here is the code I'm running to plot a 2D ellipse on the "z=10 wall" of the plot:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
import mpl_toolkits.mplot3d.art3d as art3d
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Draw a circle on the z=10 'wall'
p = Ellipse((0, 0), 6, 3, fill=False)
ax.add_patch(p)
art3d.pathpatch_2d_to_3d(p, z= 10, zdir="z")
ax.set_xlim(-10, 10)
ax.set_ylim(-10, 10)
ax.set_zlim(-10, 10)
plt.show()
However it seems that the depth axis here is considered to be y:
I'd like to have the y axis be what the z axis is right now, the x axis be what the y axis is right now, and the z axis be what the x axis is right now. Would you know how to rearange these axes?
Upvotes: 0
Views: 679