return _get_backend_mod().show(*args, **kwargs) TypeError: _Backend.show() takes 1 positional argument but 3 were given

Question:

enter image description here

How to fix these errors that are appearing again and again??????

Asked By: desirarman

||

Answers:

You should check out matplotlib.pyplot.show() and .plot() documents to know how to use them correctly.

You should use plt.plot(x, y) instead of print(plt.show(x, y))

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 25)
y = x * x + 2
plt.plot(x, y)
plt.show()
Answered By: Thaiminhpv
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.