Attributeerror Module Matplotlib Has No Attribute Plot

[Solved] Attributeerror Module Matplotlib Has No Attribute Plot | Python - Code Explorer | yomemimo.com
Question : AttributeError: module ‘matplotlib’ has no attribute ‘plot’

Answered by : itsmycode

import matplotlib.pyplot as plt
# Data to plot on x and y axis
x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
y = [5, 1, 2, 3, 1, 6, 7, 8, 6]
# create line plot
plt.plot(x, y)
# show line plot
plt.show()

Source : https://itsmycode.com/solved-attributeerror-module-matplotlib-has-no-attribute-plot/ | Last Update : Sat, 13 Aug 22

Question : AttributeError: 'module' object has no attribute 'plt'

Answered by : donpech

# Import plt directly:
import matplotlib.pyplot as plt
# Before you plot anything, set the default aesthetic parameters:
sns.set() #important, because otherwise you won't get the Seaborn palettes.
#Replace all calls to sns.plt with plt
# e.g.
plt.show()

Source : | Last Update : Wed, 29 Jun 22

Answers related to attributeerror module matplotlib has no attribute plot

Code Explorer Popular Question For Python