mirror of
https://gitee.com/py2cn/pyminer.git
synced 2024-12-02 03:37:46 +08:00
提交更改
This commit is contained in:
parent
d239660788
commit
407694b5f1
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user