MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_figure

Function test_figure

lib/matplotlib/tests/test_backend_tk.py:258–272  ·  view source on GitHub ↗
(master)

Source from the content-addressed store, hash-verified

256 root = tk.Tk()
257
258 def test_figure(master):
259 fig = Figure()
260 ax = fig.add_subplot()
261 ax.plot([1, 2, 3])
262
263 canvas = FigureCanvasTkAgg(fig, master=master)
264 canvas.draw()
265 canvas.mpl_connect("key_press_event", key_press_handler)
266 canvas.get_tk_widget().pack(expand=True, fill="both")
267
268 toolbar = NavigationToolbar2Tk(canvas, master, pack_toolbar=False)
269 toolbar.pack(expand=True, fill="x")
270
271 canvas.get_tk_widget().forget()
272 toolbar.forget()
273
274 test_figure(root)
275 print("success")

Callers 1

test_embeddingFunction · 0.70

Calls 8

drawMethod · 0.95
FigureClass · 0.90
FigureCanvasTkAggClass · 0.90
add_subplotMethod · 0.80
mpl_connectMethod · 0.80
get_tk_widgetMethod · 0.80
plotMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…