日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python matplotlib 散点图_python matplotlib散点图颜色

發布時間:2024/7/23 python 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python matplotlib 散点图_python matplotlib散点图颜色 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我試圖用x和y網格創建散點圖,其中每個點通過預先指定的值獲得顏色:{x: 1, y: 2, value: n}

我有一個x和y的列表和另一個值列表,嘗試使用這個:

^{pr2}$

錯誤:Traceback (most recent call last):

File "C:\python3.6.6\lib\site-packages\matplotlib\colors.py", line 158, in to_rgba

rgba = _colors_full_map.cache[c, alpha]

KeyError: (1.0986122886681098, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\python3.6.6\lib\site-packages\matplotlib\axes\_axes.py", line 4210, in scatter

colors = mcolors.to_rgba_array(c)

File "C:\python3.6.6\lib\site-packages\matplotlib\colors.py", line 259, in to_rgba_array

result[i] = to_rgba(cc, alpha)

File "C:\python3.6.6\lib\site-packages\matplotlib\colors.py", line 160, in to_rgba

rgba = _to_rgba_no_colorcycle(c, alpha)

File "C:\python3.6.6\lib\site-packages\matplotlib\colors.py", line 211, in _to_rgba_no_colorcycle

raise ValueError("Invalid RGBA argument: {!r}".format(orig_c))

ValueError: Invalid RGBA argument: 1.0986122886681098

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:/Users/amit neumark/Documents/????/alpha/grbs data/grbs/find_burst_location.py", line 168, in

main()

File "C:/Users/amit neumark/Documents/????/alpha/grbs data/grbs/find_burst_location.py", line 161, in main

ra2, dec2 = chi_square(model, relations)

File "C:/Users/amit neumark/Documents/????/alpha/grbs data/grbs/find_burst_location.py", line 33, in chi_square

create_plot(sums)

File "C:/Users/amit neumark/Documents/????/alpha/grbs data/grbs/find_burst_location.py", line 134, in create_plot

plt.scatter(x, y, c=colors)

File "C:\python3.6.6\lib\site-packages\matplotlib\pyplot.py", line 2793, in scatter

verts=verts, edgecolors=edgecolors, data=data, **kwargs)

File "C:\python3.6.6\lib\site-packages\matplotlib\__init__.py", line 1785, in inner

return func(ax, *args, **kwargs)

File "C:\python3.6.6\lib\site-packages\matplotlib\axes\_axes.py", line 4223, in scatter

.format(nc=n_elem, xs=x.size, ys=y.size)

ValueError: 'c' argument has 64800 elements, which is not acceptable for use with 'x' with size 64800, 'y' with size 64800.

總結

以上是生活随笔為你收集整理的python matplotlib 散点图_python matplotlib散点图颜色的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。