from PyQt5 import Qt
class Widget(Qt.QWidget):
def __init__(self):
super().__init__()
layout = Qt.QVBoxLayout(self)
button1 = Qt.QPushButton("Button 1")
button2 = Qt.QPushButton("Button 2")
layout.addWidget(button1)
layout.addWidget(button2)
button1.setStyleSheet("""
QPushButton {
background-color: green;
border-style: outset;
border-width: 2px;
border-radius: 10px;
border-color: beige;
font: bold 14px;
min-width: 10em;
padding: 6px;
}
QPushButton:pressed{
background-color: #4CAF50;
color: white;
border-color: black;
border-style: inset;
}
""")
if __name__ == '__main__':
app = Qt.QApplication([])
w = Widget()
w.show()
app.exec()
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(0, np.pi, 314)
y = np.sin(t)
plt.figure(1)
plt.plot(t, y, '-g')
plt.plot(t[100:150:5], y[100:150:5], 'og')
plt.plot(t[::10], y[::10], '*r')
plt.show()
"The text can only be a single line: newline characters are not rendered."