Rendering tree with ete3 package messes up menus in tkinter

I'm designing a desktop application using tkinter for the GUI. The application generates some nested data structures that I want to render graphically as trees. For that, I'm using the ete3 package. However, when I render the trees into an image file, the menus in the tkinter root window get messed up. The tree is rendered correctly into the image.

Here is a simplified version of the code, which has the same problem:

from tkinter import *
from tkinter import ttk, filedialog
from ete3 import Tree

root = Tk()

menubar = Menu(root)
root['menu'] = menubar
file = Menu(menubar, tearoff=0)
menubar.add_cascade(menu=file, label='File')

def plot():
    direction = filedialog.asksaveasfilename(defaultextension=".jpg", filetypes=(("jpg file", "*.jpg"),))
    tree = Tree("((a,b),c);")

ttk.Button(root, text="Plot tree to file", command=plot).grid()


The application, before rendering the tree, looks like this: image1

And after rendering the tree: image2

Also, if I delete the tree.render(direction) line, the problem doesn't occur. Any ideas what might be causing this?