I have been trying to code a small program with windows and buttons that in the end will plot a graph and hopefully a chart with some info on a window with buttons on it.
I have looked all over the web for help, but so far came up with the code below:
import sys
import os.path
from PyQt5 import QtCore, QtGui, QtWidgets
PyQt5.QtWidgets import QApplication, QMainWindow, QWidget,
QPushButton
import numpy as np
class visa_resultat(QWidget):
def __init__(self, parent=None):
super(visa_resultat, self).__init__(parent)
self.B_Knapp = QPushButton('Back', self)
self.B_Knapp.move(310, 350)
self.B_Knapp.resize(280,40)
self.L_Knapp = QPushButton('Ladda', self)
self.L_Knapp.move(10, 350)
self.L_Knapp.resize(280,40)
def start_visa_resultat(self):
self.Window = visa_resultat(self)
self.setWindowTitle("Kolla resultatet")
self.setCentralWidget(self.Window)
self.Window.B_Knapp.clicked.connect(self.startResultatWindow)
self.Window.L_Knapp.clicked.connect(self.loadYT)
self.show()
def loadYT(self):
t,y = self.file_open()
jump_height, pltVrs = jumpTests.oneJump(y,t)
jumpTests.plotOneJump(t,pltVrs)
Here in the window start_visa_resultat
I would like to have a canvas where I can load data and show a graph on.
Thanks for reading all this and maybe help me