提交更改

This commit is contained in:
hzy15610046011 2020-12-07 19:00:53 +08:00
parent d239660788
commit 407694b5f1
2 changed files with 63 additions and 4 deletions

View File

@ -58,3 +58,58 @@ class HistPlot(PMGFlowContent):
print('load info!!!!!!!!!!')
self.info = info
print(self.info)
class DataReplace(PMGFlowContent):
"""
根据输入的数据绘制一条直线
允许输入的数据类型多个端口的直线
"""
def __init__(self):
super(DataReplace, self).__init__()
self.input_args_labels = ['in']
self.output_ports_labels = ['out']
self.class_name = None
self.text = 'HistPlot'
self.icon_path = ''
self.agg = None
# self.info = {'gen_array': False, 'size': (1, 2, 3),
# 'type': 'normal'} # 命名为self.info的变量会被自动保存下一次会调用load_info方法进行读取。
def process(self, *args) -> List:
"""
Args:
*args:
Returns:
"""
if self.agg is None:
self.agg = PMAgg.Window()
# plt.plot([1, 2, 3, 4, 5])
plt.hist(x=args, # 指定绘图数据
bins=20, # 指定直方图中条块的个数
color='steelblue', # 指定直方图的填充色
edgecolor='black' # 指定直方图的边框色
)
fig = plt.gcf()
self.agg.get_canvas(fig)
self.agg.show()
return []
def check_data(self, data):
pass
def load_info(self, info: dict):
print('load info!!!!!!!!!!')
self.info = info
print(self.info)
def on_settings_requested(self, parent):
pass

View File

@ -3,7 +3,11 @@ class F():
aaa = 123333333333333
print(123123)
fff=123
a=123
b=566
ttt=12312312313131
while (1):
s = input(">>>>")
print(s)
fff = 123
a = 123
b = 566
ttt = 12312312313131