python plt.scatter label
时间: 2023-10-14 15:03:25 浏览: 156
在使用Matplotlib绘制散点图时,可以使用plt.scatter函数添加标签。该函数可以通过设置参数label来添加标签。例如,plt.scatter(X[:, 0], X[:, 1], label="data")会在散点图中添加一个标签为"data"的标签。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Python Matplotlib画图基础介绍](https://blog.csdn.net/xbinworld/article/details/104224007)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Python中Matplotlib.pyplot之二维线形图plt.plot( )套路总结](https://blog.csdn.net/NJUSTZJC/article/details/120235221)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文