Hi, i'm trying to make a simple 3d plot of a cylinder with plot_surface. There are two problems in my output: 1) the shading, shading does not work on the cylindric shell and at the same time produces weird artifacts on the top cover. http://old.nabble.com/file/p29254649/cyl-shade-error.png
2) Sometimes, not reproducible, the inner back of the cylindric shell is plotted in front of the top cover. It seems, that it depends somehow on the order of the plot commands, so that switching the two plot command helps... but not all the time. http://old.nabble.com/file/p29254649/cyl-clip-error.png Am I doing something fundamentally wrong here? ########################## from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from matplotlib import cm fig = plt.figure() ax = Axes3D(fig) # Cylindrical shell phi = np.linspace(0, 2 * np.pi, 100) r = np.ones(100) h = np.linspace(0, 1, 100) x = 10 * np.outer(np.cos(phi), r) y = 10 * np.outer(np.sin(phi), r) z = 10 * np.outer(np.ones(np.size(r)), h) # Top cover phi_a = np.linspace(0, 2 * np.pi, 100) h_2 = np.ones(100) r_2 = np.linspace(0, 1, 100) x_2 = 10 * np.outer(np.cos(phi), r_2) y_2 = 10 * np.outer(np.sin(phi), r_2) z_2 = 10 * np.ones([100,100]) ax.plot_surface(x, y, z, rstride=9, cstride=15, linewidth=1, alpha=1) ax.plot_surface(x_2, y_2, z_2, rstride=5, cstride=20, linewidth=1, alpha=1) ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') plt.show() ########################## I'm just a beginner and installed the Enthought Python Distribution 6.2-2, which unfortunately does not use the matplotlib version 1.0. Since I could not find the .egg install file on the matplotlib site I guess I'll have to wait until they update EPD.... self compiling is not a real option for me. Thanks any suggestions! -- View this message in context: http://old.nabble.com/plot_surface-shading-and-clipping-error-tp29254649p29254649.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users