Can i over draw more elements into a canvas in tkinter?

55 Views Asked by At

i want to know if there is a way to draw more elements into a canvas in tkinter. My goal is to display in a canvas a trajectory made with plotnine and two circles as the boundaries like in the attached image:

enter image description here

First of all i've created the plots with the trajectory, then i saved it in a image and i've assigned a canvas for each image like this:

vis=ggplot()+geom_point(aes(x='xR', y='yR', color='factor(repetitionID)'), traiettoria_utente)+ facet_grid("hand~repetitionID")+ coord_fixed()
            vis=vis+theme(legend_position=None, axis_text_x=element_blank(),axis_text_y=element_blank(),axis_title_x=element_blank(),axis_title_y=element_blank(),axis_ticks=element_blank(),panel_background=element_blank(), legend_key_size=8)
            vis=vis+labs(color='Ripetizione', title=f"{first_user_id}")+coord_fixed()

            vis.save(f'{dest_folder}plot_{i}.png', dpi=500)

        img = Image.open(f'{dest_folder}plot_{i}.png')
        resized_image = img.resize((dim_width, dim_height), Image.LANCZOS) 
        image_container.plot_image.append(ImageTk.PhotoImage(resized_image))

       
        vis_canvas = Canvas(plot_frame, width=dim_width, height=dim_height)
        vis_canvas.grid(row=i // num_columns, column=i % num_columns, padx=2, pady=2)


        vis_canvas.create_image(0, 0, anchor=NW, image=image_container.plot_image[-1])

now that i have created the trajectory i don't know how to integrate and if it's possible to integrate the two circles.

This is what this code generates:

this is what this code generates

0

There are 0 best solutions below