Seite 1 von 1

Plotten der Koordinaten Ebenen

Verfasst: Dienstag 26. November 2013, 11:03
von Grizzly
Hallo,

ich frage mich was der einfachste Weg ist die drei Koordinaten Ebenen in 3d zu plotten ? Mayavi oder Matplotlib is eigentlich egal....

Ich bin gespannt !

Re: Plotten der Koordinaten Ebenen

Verfasst: Mittwoch 27. November 2013, 12:18
von Grizzly
Hier mal mein aktueller Stand:
Mein Problem ist, dass eine optische Täuschung entsteht, die ich eigentlich vermeiden möchte :roll:

Code: Alles auswählen

from mpl_toolkits.mplot3d import *
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm

fig = plt.figure()
ax = fig.gca(projection='3d')               
plt.hold(True)

x_surf=np.arange(-1, 1, 0.1)                
y_surf=np.arange(-1, 1, 0.1)
x_surf, y_surf = np.meshgrid(x_surf, y_surf)
z_surf = np.zeros(x_surf.shape)             
ax.plot_surface(x_surf, y_surf, z_surf, color='r')   

x_surf=np.arange(-1, 1, 0.1)                
z_surf=np.arange(-1, 1, 0.1)
x_surf, z_surf = np.meshgrid(x_surf, z_surf)
y_surf = np.zeros(y_surf.shape)             
ax.plot_surface(x_surf, y_surf, z_surf, color='b')    

y_surf=np.arange(-1, 1, 0.1)                
z_surf=np.arange(-1, 1, 0.1)
y_surf, z_surf = np.meshgrid(y_surf, z_surf)
x_surf = np.zeros(x_surf.shape)             
ax.plot_surface(x_surf, y_surf, z_surf, color='g')    

ax.set_xlabel('x label')
ax.set_ylabel('y label')
ax.set_zlabel('z label')

plt.show()