# import matplotlib.pyplot as plt
#
# data_dict = {'data_x': [1, 2, 3, 4, 5], 'data_y': [2, 3, 5, 10, 8]}
# da_dict = {'date_x': [2, 4, 6, 7, 8], 'date_y': [3, 5, 8, 7, 8]}
#
# plt.plot('data_x', 'data_y', 'b-', data=data_dict, label='peace')
#
# plt.plot('date_x', 'date_y', 'r-', data=da_dict, label='peace1')
#
# plt.xlabel('X-Label', labelpad=5, fontdict={'family': 'serif', 'color': 'g', 'weight': 'bold', 'size': 13}, loc='right')
# plt.ylabel('Y-Label', labelpad=2, fontdict={'family': 'serif', 'color': 'r', 'weight': 'regular', 'size': 13, },
# loc='top')
#
# plt.xlim([0, 9])
# plt.ylim([0, 10])
#
# plt.legend(loc='upper left', ncol=1)
#
# plt.show()
## Ex 5-13. QCalenderWidget.
# import sys
# from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QCalendarWidget
# from PyQt5.QtCore import QDate
#
#
# class MyApp(QWidget):
#
# def init(self):
# super().__init__()
# self.initUI()
#
# def initUI(self):
# cal = QCalendarWidget(self)
# cal.setGridVisible(True)
# cal.clicked[QDate].connect(self.showDate)
#
# self.lbl = QLabel(self)
# date = cal.selectedDate()
# self.lbl.setText(date.toString())
#
# vbox = QVBoxLayout()
# vbox.addWidget(cal)
# vbox.addWidget(self.lbl)
#
# self.setLayout(vbox)
#
# self.setWindowTitle('QCalendarWidget')
# self.setGeometry(300, 300, 400, 300)
# self.show()
#
# def showDate(self, date):
# self.lbl.setText(date.toString())
#
#
# if name == '__main__':
# app = QApplication(sys.argv)
# ex = MyApp()
# sys.exit(app.exec_())
## Ex 8-3. 직사각형 그리기 (drawRect).
# import matplotlib.pyplot as plt
# import numpy as np
#
# x = np.arange(0, 2, 0.2)
#
# plt.plot(x, x, 'bo')
# plt.plot(x, x**2, color='#e35f62', marker='*', linewidth=2)
# plt.plot(x, x**3, color='forestgreen', marker='^', markersize=9)
# plt.xticks([0, 1, 2],label = ['Jan', 'Feb', 'Mar'])
# plt.yticks(np.arange(1, 6))
# plt.grid(True, axis='y')
#
# plt.show()
## Ex 3-1. 창 띄우기.
import sys
from PyQt5.QtWidgets import QApplication, QWidget
class MyApp(QWidget):
def init(self):
super().__init__()
self.initUI()
def initUI(self):
self.setWindowTitle('My py')
self.move(350, 350)
self.resize(400, 365)
if name == '__main__':
app = QApplication(sys.argv)
ex = MyApp()
sys.exit(app.exec_())