Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/08/2013, 12:50
Bael_Balzac
 
Fecha de Ingreso: julio-2011
Mensajes: 62
Antigüedad: 12 años, 9 meses
Puntos: 0
Pregunta [Matplotlib] Graficar superficie triangular

El gráfico visto de arriba siempre debe ser un triángulo:
Código Python:
Ver original
  1. from mpl_toolkits.mplot3d import axes3d
  2. import matplotlib.pyplot as plt
  3. import numpy as np
  4.  
  5. x = np.arange(0, 1, 0.01)
  6. y = np.arange(0, 1, 0.01)
  7. x, y = np.meshgrid(x, y)
  8.  
  9. xtemp = np.tri(100, 100, 0)
  10. xtemp = np.rot90(xtemp, -1)
  11. ytemp = np.tri(100, 100, 0)
  12. ytemp = np.rot90(ytemp, -1)
  13.  
  14. x = x*xtemp
  15. y = y*ytemp
  16.  
  17. L1 = 1 - x - y
  18. L2 = x
  19. L3 = y
  20.  
  21. L = [L1, L2, L3]
  22.  
  23. for i in range(3):
  24.     fig = plt.figure()
  25.     ax = fig.add_subplot(111, projection='3d')
  26.     ax.plot_wireframe(x, y, L[i], rstride=10, cstride=10)
  27.     ax.set_title('Funcion ' + str(i + 1))
  28. plt.show()

Presenta errores en un borde y al graficar como una superficie también presenta errores.