実現したいこと
pythonでボロノイ図のプログラムを動かしたい
前提
linuxでpythonを起動しています。
その中で、ボロノイ図のプログラムを実装中に以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
以下のエラーメッセージが出て出力がされない。
python
1Traceback (most recent call last): 2 File "Voro1.py", line 12, in <module> 3 fig = voronoi_plot_2d(vor) 4 File "<decorator-gen-4>", line 2, in voronoi_plot_2d 5TypeError: _held_figure() takes from 2 to 3 positional arguments but 4 were given
該当のソースコード
python
1import numpy as np 2from scipy.spatial import Voronoi, voronoi_plot_2d 3import matplotlib.pyplot as plt 4points = np.random.rand(50, 2) 5vor = Voronoi(points) 6fig = voronoi_plot_2d(vor) 7plt.savefig('voronoi.png')
試したこと
細かいところを変えましたが特に変化はありませんでした。
補足情報(FW/ツールのバージョンなど)
pythonは3.8.10です。
またscipyは1.3.3、numpyは1.17.4です。
scipy などのモジュールのバージョンも追記いただけますか。
ありがとうございます。
以下に添付いたします。
absl-py                 0.14.0       
apturl                  0.5.2        
astunparse              1.6.3        
atomicwrites            1.1.5        
attrs                   19.3.0       
Automat                 0.8.0        
backcall                0.1.0        
bcrypt                  3.1.7        
beautifulsoup4          4.8.2        
bleach                  3.1.1        
blinker                 1.4          
Brlapi                  0.7.0        
cachetools              4.2.2        
certifi                 2019.11.28   
chainer                 7.8.0        
chardet                 3.0.4        
clang                   5.0          
Click                   7.0          
colorama                0.4.3        
command-not-found       0.3          
constantly              15.1.0       
cryptography            2.8          
cupshelpers             1.0          
cycler                  0.10.0       
dbus-python             1.2.16       
decorator               4.4.2        
defer                   1.0.6        
defusedxml              0.6.0        
distro                  1.4.0        
distro-info             0.23ubuntu1  
duplicity               0.8.12.0     
entrypoints             0.3          
enum34                  1.1.10       
epoptes                 20.1.post1   
et-xmlfile              1.0.1        
fasteners               0.14.1       
filelock                3.0.12       
flatbuffers             1.12         
future                  0.18.2       
gast                    0.4.0        
google-auth             1.35.0       
google-auth-oauthlib    0.4.6        
google-pasta            0.2.0        
grpcio                  1.40.0       
h5py                    3.1.0        
html5lib                1.0.1        
httplib2                0.14.0       
hyperlink               19.0.0       
idna                    2.8          
importlib-metadata      1.5.0        
incremental             16.10.1      
ipykernel               5.2.0        
ipython                 7.13.0       
ipython-genutils        0.2.0        
ipywidgets              6.0.0        
jdcal                   1.0          
jedi                    0.15.2       
Jinja2                  2.10.1       
joblib                  0.14.0       
jsonschema              3.2.0        
jupyter-client          6.1.2        
jupyter-core            4.6.3        
keras                   2.6.0        
Keras-Preprocessing     1.1.2        
keyring                 18.0.1       
kiwisolver              1.0.1        
language-selector       0.1          
launchpadlib            1.10.13      
lazr.restfulclient      0.14.2       
lazr.uri                1.0.3        
lockfile                0.12.2       
louis                   3.12.0       
lxml                    4.5.0        
macaroonbakery          1.3.1        
Mako                    1.1.0        
Markdown                3.3.4        
MarkupSafe              1.1.0        
matplotlib              3.1.2        
mistune                 0.8.4        
monotonic               1.5          
more-itertools          4.2.0        
nbconvert               5.6.1        
nbformat                5.0.4        
netifaces               0.10.4       
nose                    1.3.7        
notebook                6.0.3        
numexpr                 2.7.1        
numpy                   1.17.4       
oauthlib                3.1.0        
olefile                 0.46         
opencv-python           4.5.3.56     
openpyxl                3.0.3        
opt-einsum              3.3.0        
packaging               20.3         
pandas                  0.25.3       
pandas-ml               0.6.1        
pandocfilters           1.4.2        
paramiko                2.6.0        
parso                   0.5.2        
pexpect                 4.6.0        
pickleshare             0.7.5        
Pillow                  7.0.0        
pip                     20.0.2       
pluggy                  0.13.0       
prometheus-client       0.7.1        
prompt-toolkit          2.0.10       
protobuf                3.6.1        
psutil                  5.5.1        
py                      1.8.1        
pyasn1                  0.4.8        
pyasn1-modules          0.2.8        
pycairo                 1.16.2       
pycups                  1.9.73       
Pygments                2.3.1        
PyGObject               3.36.0       
PyHamcrest              1.9.0        
PyJWT                   1.7.1        
pymacaroons             0.13.0       
PyNaCl                  1.3.0        
pyOpenSSL               19.0.0       
pyparsing               2.4.6        
pyRFC3339               1.1          
pyrsistent              0.15.5       
pytest                  4.6.9        
python-apt              2.0.1        
python-dateutil         2.7.3        
python-debian           0.1.36ubuntu1
pytz                    2019.3       
pyxdg                   0.26         
PyYAML                  5.3.1        
pyzmq                   18.1.1       
reportlab               3.5.34       
requests                2.22.0       
requests-oauthlib       1.3.0        
requests-unixsocket     0.2.0        
rsa                     4.7.2        
scikit-learn            0.22.2.post1 
scipy                   1.3.3        
screen-resolution-extra 0.0.0        
SecretStorage           2.3.1        
Send2Trash              1.5.0        
service-identity        18.1.0       
setuptools              45.2.0       
simplejson              3.16.0       
sip                     4.19.21      
six                     1.14.0       
soupsieve               1.9.5        
ssh-import-id           5.10         
systemd-python          234          
tables                  3.6.1        
tensorboard             2.6.0        
tensorboard-data-server 0.6.1        
tensorboard-plugin-wit  1.8.0        
tensorflow              2.6.0        
tensorflow-estimator    2.6.0        
termcolor               1.1.0        
terminado               0.8.2        
testpath                0.4.4        
tornado                 5.1.1        
traitlets               4.3.3        
Twisted                 18.9.0       
typing-extensions       3.10.0.2     
ubuntu-advantage-tools  8001         
ubuntu-drivers-common   0.0.0        
ufw                     0.36         
unattended-upgrades     0.1          
urllib3                 1.25.8       
usb-creator             0.3.7        
wadllib                 1.3.3        
wcwidth                 0.1.8        
webencodings            0.5.1        
Werkzeug                2.0.1        
wheel                   0.37.0       
widgetsnbextension      2.0.0        
wrapt                   1.12.1       
wxPython                4.0.7        
xkit                    0.0.0        
xlrd                    1.1.0  
回答はここではなく、質問を編集して追記したほうがみやすく、多くの他人の目に触れやすいですよ。
わかりました。そうしてみます

