I have a question about matplotlib.An error occurred while executing the following code:
How can I set the
_init__() missing 1 required positional argument: 'figure'
import numpy as np import matplotlib.pyplot asplt x = [1,1,1,1] y = [2,2,2,2] plt.scatter(x,y)
I will transcribe comment as answer.(Adding line breaks)
Is there a problem with the environment or the number of editions?
Windows 10 64bit, Python 3.7.6, numpy 1.18.1, matplotlib 3.1.2 did not fail.
Or try describing the detailed steps by referring to this article.
How to draw a scatterplot with Matplotlib
Come to think of it, was there a Q&A that said there was a problem typing in different cells one line at a time in the Jupiter Notebook environment?
For example, in the middle of this article, a scatter diagram is displayed in matplotlib, so please refer to it.
Try the Jupiter Notebook
The Win10 64bit, Python 3.6, numpy 1.16.2, matplotlib 3.0.3 did not reproduce the error.
© 2023 OneMinuteCode. All rights reserved.