作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有来自不同社区的人,我想根据他们的距离使用不同颜色的散点图直观地绘制:如果他们靠近其他点,他们应该采用相似的颜色。
我知道对于散点图我应该使用以下内容
ax1 = df.plot.scatter(x='Year',
y='Community')
但我不知道如何设置类似的条件。例如:
Community Year
com1 2006
com2 2012
com3 2006
com4 2013
com5 1996
com6 2008
...
我应该让 com1 和 com3 颜色相同,com6 颜色相似,而 com2 和 com4 应该颜色相似。
我认为这与渐变有关。你能给我一些关于如何在 python 中执行此操作的信息吗?
最佳答案
关于python - 基于年龄相似度的散点图渐变色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64345357/
我是一名优秀的程序员,十分优秀!