Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将散点图上的点与颜色图相关的线连接起来_Python_Matplotlib_Jupyter - Fatal编程技术网

Python 将散点图上的点与颜色图相关的线连接起来

Python 将散点图上的点与颜色图相关的线连接起来,python,matplotlib,jupyter,Python,Matplotlib,Jupyter,我对编码的世界非常陌生,我正在努力完成课堂作业。我能画出彩色地图,但我不知道如何连接不同的点。我知道行集合可以使用,但我就是不明白。这是我到目前为止所拥有的 plt.figure(figsize=(13,7)) plt.plot(radius_data['AtomicRadius'], radius_data['Group'],linestyle='dashed', linewidth=.5) plt.scatter(radius_data['AtomicRadius'],ra

我对编码的世界非常陌生,我正在努力完成课堂作业。我能画出彩色地图,但我不知道如何连接不同的点。我知道行集合可以使用,但我就是不明白。这是我到目前为止所拥有的

plt.figure(figsize=(13,7))
plt.plot(radius_data['AtomicRadius'], radius_data['Group'],linestyle='dashed',
         linewidth=.5)
plt.scatter(radius_data['AtomicRadius'],radius_data['Group'], s=10, c=radius_data['Period'], cmap='ocean')
plt.colorbar(label='Period')
plt.title('Correlation Between Atomic Radius, Group and Period')
plt.xlabel('Atomic Radius', fontsize=12)
plt.ylabel('Group', fontsize=12)
plt.xlim(0,3.5)
plt.ylim(1,18)
plt.grid()
我的图表:


你看了吗?如果是这样,你在哪里被卡住了?是的,我被卡住了,但我的问题与这里给出的解决方案有关: