@@ -27,16 +27,13 @@ def slider_uno(self, event):
27
27
def slider_dos (self , event ):
28
28
self .grafica .datos2 (event )
29
29
30
-
31
30
class Canvas_grafica (FigureCanvas ):
32
31
def __init__ (self , parent = None ):
33
32
self .fig , self .ax = plt .subplots (facecolor = 'gray' )
34
33
super ().__init__ (self .fig )
35
34
self .ax .grid ()
36
35
self .ax .margins (x = 0 )
37
36
38
-
39
-
40
37
self .nivel1 = 10
41
38
self .nivel2 = 1
42
39
self .grafica_datos ()
@@ -51,12 +48,10 @@ def grafica_datos(self):
51
48
plt .title ("Grafica en PyQt5 con Matplotlib" )
52
49
#plt.xlim(-4, 32)
53
50
#plt.ylim(-12, 12)
54
-
55
51
x = np .arange (- np .pi , 10 * np .pi , 0.01 )
56
52
line , = self .ax .plot (x , self .nivel1 * np .sin (self .nivel2 * x ), color = 'r' ,linewidth = 2 )
57
53
self .draw ()
58
- line .set_ydata (np .sin (x )+ 24 )
59
-
54
+ line .set_ydata (np .sin (x )+ 24 )
60
55
#print(self.nivel1, self.nivel2)
61
56
QtCore .QTimer .singleShot (10 , self .grafica_datos )
62
57
@@ -66,13 +61,12 @@ def grafica_datos(self):
66
61
mi_app = MiApp ()
67
62
mi_app .show ()
68
63
sys .exit (app .exec_ ())
69
-
70
- #self.ax = plt.axes()
71
- #self.ax=plt.gca()
72
- #plt.axis('off')
73
- #self.fig.subplots_adjust(top=1.1 ,bottom=-0.1, left=-0.1, right=1.1)
74
- #self.ax.get_xaxis().set_visible(False)
75
- #self.ax.spines['right'].set_visible(False)
76
- #self.ax.spines['top'].set_visible(False)
77
- #self.ax.spines['bottom'].set_visible(False)
78
- #self.ax.spines['left'].set_visible(False)
64
+ #self.ax = plt.axes()
65
+ #self.ax=plt.gca()
66
+ #plt.axis('off')
67
+ #self.fig.subplots_adjust(top=1.1 ,bottom=-0.1, left=-0.1, right=1.1)
68
+ #self.ax.get_xaxis().set_visible(False)
69
+ #self.ax.spines['right'].set_visible(False)
70
+ #self.ax.spines['top'].set_visible(False)
71
+ #self.ax.spines['bottom'].set_visible(False)
72
+ #self.ax.spines['left'].set_visible(False)
0 commit comments