如何在一个窗口中显示两个图形(绘图)?

2024-10-03 11:25:35 发布

您现在位置:Python中文网/ 问答频道 /正文

图1和图1给出了两个不同的曲线图。弹出两个不同的窗口。我想把这两个情节显示在一个窗口中,可以用中间的一条线隔开。我该怎么做?你知道吗

packing_options = get_packing_options(min_w, max_w, min_l, max_l, rect_list, step_size = 1, \

result_list = []
for opt in packing_options:
    step_w = float(get_max(opt.sheets))
    tmp_sheets = trim_sheets(opt.sheets, max(min_w,step_w), min_l)
    tmp_l = float(get_max(tmp_sheets,False))
    tmp_result_list = []
    tmp_w = step_w
    while area/tmp_w >= tmp_l:
        tmp_sheet = Sheet(tmp_w, area/tmp_w)
        tmp_result_list.append(find_best_packing_GA(tmp_sheet, sheets_to_rect_list(tmp_sheets), \
                                                    Pm = 0, rotate_prob = 0, flex = True, only_vertical = True))
        tmp_w = tmp_w + step_w
    result_list.append(best_individual(tmp_result_list)[0])

best, avg_fit, best_index = best_individual(result_list)


fig = packing_options[best_index].plot_sheets()

dataPlot = FigureCanvasTkAgg(fig, master = window)
dataPlot.draw()
dataPlot.get_tk_widget().pack(side='top', fill='both', expand=1)

fig1 = best.plot_sheets()

dataPlot1 = FigureCanvasTkAgg(fig1, master = window)
dataPlot1.draw()
dataPlot1.get_tk_widget().pack(side='top', fill='both', expand=1)

这是输出的图片:https://imgur.com/NZaZkwa


Tags: rectgetstepresultmintmpmaxlist