Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def task_1(self):
- """Первое задание"""
- self.ui.MainMenu.setCurrentIndex(1)
- fig = Figure(figsize=(5, 5))
- can = FigureCanvasQTAgg(fig)
- layout = QtWidgets.QVBoxLayout(self.ui.graphic)
- layout.addWidget(can)
- # here you can set up your figure/axis
- ax = can.figure.add_subplot(111)
- # plot a basic line plot from x and y values.
- ax.cla() # clears the axis
- x = np.arange(-10, 10, 0.1)
- y = np.cos(x) * np.cos(x) * np.cos(x) * np.sin(x)
- for i in range(0, len(y)):
- y[i] = y[i] - (5 * x[i]) / (np.sin(2 * x[i]) * np.cos(x[i]))
- ax.plot(x, y)
- ax.grid(True)
- can.figure.tight_layout()
- can.draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement