"_init__() missing 1 required positional argument: 'figure'" error when using scatter in matplotlib

Asked 5 months ago, Updated 5 months ago, 10 views

I have a question about matplotlib.An error occurred while executing the following code:
How can I set the figure argument?

error message

_init__() missing 1 required positional argument: 'figure'

source code

import numpy as np
import matplotlib.pyplot asplt

x = [1,1,1,1]
y = [2,2,2,2]

python matplotlib

2022-09-30 14:09

1 Answers

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.

2022-09-30 14:09

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.