Plotten der Koordinaten Ebenen

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
Benutzeravatar
Grizzly
User
Beiträge: 34
Registriert: Sonntag 10. Februar 2013, 21:18

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 !
Benutzeravatar
Grizzly
User
Beiträge: 34
Registriert: Sonntag 10. Februar 2013, 21:18

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()
Antworten