import matplotlib.pyplot as plt
import numpy
if __name__ == '__main__':
plt.plot([0, 10], [0, 0], marker='o', markersize=8, linewidth=4)
for x in numpy.linspace(3, 5, num=21):
plt.arrow(x, 0, 0, 0.4*(x-3)*(5-x), head_width=0.1, head_length=0.01, length_includes_head=True, color='red')
plt.ylim(-0.5, 0.5)
plt.show()
import sys
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QMainWindow, QLabel, QLineEdit
from PyQt5.QtCore import QSize
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setMinimumSize(QSize(320, 140))
self.setWindowTitle("PyQt Line Edit example (textfield) - pythonprogramminglanguage.com")
self.nameLabel1 = QLabel(self)
self.nameLabel1.setText('First Name:')
self.nameLabel1.move(20, 20)
self.line1 = QLineEdit(self)
self.line1.move(80, 20)
self.line1.resize(200, 32)
self.nameLabel2 = QLabel(self)
self.nameLabel2.setText('Second Name:')
self.nameLabel2.move(20, 60)
self.line2 = QLineEdit(self)
self.line2.move(80, 60)
self.line2.resize(200, 32)
self.line1.textChanged.connect(self.change_linedit)
self.line2.textChanged.connect(self.change_linedit)
def change_linedit(self, txt):
sender = self.sender()
print('Your name: '+txt, id(sender))
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
mainWin = MainWindow()
print(f'{id(mainWin.line1)=}')
print(f'{id(mainWin.line2)=}')
print()
mainWin.show()
sys.exit(app.exec_())