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

时间:2019-05-03 09:28:30

标签: python matplotlib tkinter tkinter-canvas

图和图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

0 个答案:

没有答案
相关问题