如何让用户选择绘图功能(Python / Repl.it)?

时间:2018-09-17 14:57:15

标签: python function plot trigonometry repl.it

如何更改此程序,以便用户可以输入功能而不是sin(5*x)

from math import *
import matplotlib as mpl
mpl.use('Agg')
import numpy as np
import matplotlib.pyplot as plt

x = np.arange(-2*pi, 2*pi, 0.1)
y1 = np.sin(5*x)

plt.plot(x, y1)
plt.savefig('graph.png')

0 个答案:

没有答案