0

I am using below code to visualize my algorithm. but I am facing issue with following error.

AttributeError: Unknown property colour

from matplotlib import pyplot as plt 
regression = LinearRegression()
model = regression.fit(X_train,Y_train)
preds = model.predict(X_test)

plt.scatter(X_train,Y_train, colour = 'red')
plt.plot(X_train, preds, colour = 'blue')
plt.title('salary vs experiance')
plt.xlabel("years")
plt.ylabel("salary")
plt.show()
2
  • "Facing issue"? What issue? Maybe include the desired actions, what should happen, a screenshot of what is wrong (if it is a plot or image of sorts), the error you get, if you get one, and basically everything else you should put in a question here on Stack Overflow? Commented Dec 29, 2018 at 17:10
  • 1
    Its color, how about checking the documentation? Commented Dec 29, 2018 at 17:10

1 Answer 1

2

you should give it as color instead of colour

plt.scatter(X_train,Y_train, color = 'red')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.