I'm trying to plot two functions func1 and func2 using matplotlib and python. I keep getting a ValueError for the following code and have no idea what is wrong. I've searched through related questions, tried a ton of things, and nothing seems to work.
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
plt.xlim(0, 10)
plt.ylim(0, 10)
plt.xlabel('$X$')
plt.ylabel('$Outputs$')
plt.title('Title')
x = np.arange(0, 10, .1)
def func1(X):
output = max(3*X/7 - 3/7, 0, 12*X/35 - 3/35)
return output
def func2(X):
output = max(3*X/7 - 3/7, 0)
return output
plt.plot(x, func1(x), 'g')
plt.plot(x , func2(x), 'b')
plt.show()
