python - 以不同的形状绘制第一个点
问题描述
我正在通过以下方式进行集群可视化:
for k in range(0, n_clusters):
x=[]
y=[]
for j in range(0, len(final_cluster_result[k])):
x_res = list(final_cluster_result[k][j].longitude)
y_res = list(final_cluster_result[k][j].latitude)
x.append(x_res)
y.append(y_res)
x = [s for t in x for s in t]
y = [s for t in y for s in t]
plt.plot(x,y,'o',markersize=3)
# plt.scatter(x,y)
plt.grid()
plt.title('Clusters',fontsize=14)
plt.xlabel("Longitude",fontsize=15)
plt.ylabel("Latitude",fontsize=15)
我想以不同的形状绘制集群/颜色的每个起点(以了解运动从哪里开始)
我想要:对于蓝色绘图的第一个点,带有蓝色的黑点对于 rescolor 绘图的第一个点,带有红色的黑点...
解决方案
同意@Quang-Hoang,在这里粘贴以供其他人过滤没有答案的问题:
在 plt.plot(x,y,'o',markersize=3) 之后做 plt.plot([x[0]], [y[0]], 's', markersize=5)
推荐阅读
- dart - 通用函数:不是预期类型的类型
- javascript - Rails/Webpack:如何确保导入的组件可以看到 jquery?
- ios - Xcode 中的构建错误。链接有问题
- docker - 在 Apache Ignite 上为 Docker 启动 WebAgent
- php - 格式错误的 EUR 字符串
- java - 使用 CompareTo 时将字符串转换为长整数
- linux - c++线程不能重用main分配的释放内存
- json - JSON4S 无法反序列化对象
- python - 以指定格式填充缺失值 - Python
- ethereum - 外部函数中参数的数据位置必须是“calldata”,但没有给出