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

Function submit

galleries/examples/widgets/textbox.py:28–39  ·  view source on GitHub ↗

Update the plotted function to the new math *expression*. *expression* is a string using "t" as its independent variable, e.g. "t ** 3".

(expression)

Source from the content-addressed store, hash-verified

26
27
28def submit(expression):
29 """
30 Update the plotted function to the new math *expression*.
31
32 *expression* is a string using "t" as its independent variable, e.g.
33 "t ** 3".
34 """
35 ydata = eval(expression, {'np': np}, {'t': t})
36 l.set_ydata(ydata)
37 ax.relim()
38 ax.autoscale_view()
39 plt.draw()
40
41
42axbox = fig.add_axes((0.1, 0.05, 0.8, 0.075))

Callers

nothing calls this directly

Calls 4

set_ydataMethod · 0.80
relimMethod · 0.80
autoscale_viewMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…