Modification axes 3D

main
Gaël Pongnot 2 years ago
parent e9a79c5bf7
commit 7b0d238306
  1. 16
      MLI_vectorielle.py

@ -7,6 +7,7 @@ from matplotlib.widgets import Slider, Button, CheckButtons
from matplotlib.axes import Axes
from matplotlib.projections.polar import PolarAxes
from mpl_toolkits.mplot3d.axes3d import Axes3D
from matplotlib.animation import FuncAnimation
PI = np.pi
@ -251,7 +252,7 @@ class TriPlot_3DAxe(Axes3D):
for i in range(3):
self.plot_list.append(
self.plot(self.v_re[i,:], self.v_im[i,:],
self.plot(self.v_im[i,:], self.v_re[i,:],
self.theta
)[0]
)
@ -264,8 +265,8 @@ class TriPlot_3DAxe(Axes3D):
#self.set_box_aspect((4,1,1))
self.set_facecolor("#00000000")
self.set_title("Visualisation 3D")
self.set_xlabel("Partie réelle")
self.set_ylabel("Partie imaginaire")
self.set_xlabel("Partie imaginaire")
self.set_ylabel("Partie réelle")
self.set_zlabel("Angle")
# Début de code pour un plan "phi" dans l'espace 3D
@ -308,18 +309,19 @@ class TriPlot_3DAxe(Axes3D):
)
def projX(self, event=None):
self.view_init(89.99, -90.01, 'y')
self.view_init(0, -90.01, 'y')
self.get_figure().canvas.draw()
def projY(self, event=None):
self.view_init(0, -90.01, 'y')
self.view_init(89.99, -90.01, 'y')
self.get_figure().canvas.draw()
def projZ(self, event=None):
self.view_init(0, 0, 'y')
self.view_init(0, 90, 'x')
self.get_figure().canvas.draw()
return
class TriPlot:
"""Classe de graphique MLI"""
@ -418,7 +420,6 @@ class TriPlot:
win = self.fig.canvas.window()
win.setMinimumSize(1200, 800)
win.showMaximized()
return
def refresh(self, val=None):
# Lecture des nouvelles valeurs
@ -474,6 +475,7 @@ class TriPlot:
axe.set_parameters(self.parameters)
return
if __name__ == '__main__':
# Execute when the module is not initialized from an import statement.
plt.close('all')

Loading…
Cancel
Save