網站首頁 編程語言 正文
scatter繪畫散點圖代碼如下:
import matplotlib.pyplot ?as plt
plt.scatter(x,y,
? ? ? ? ? ? ? ? s = 20
? ? ? ? ? ? ? ? c='b'
? ? ? ? ? ? ? ? marker=‘o'
? ? ? ? ? ? ? ? cmap=None,
? ? ? ? ? ? ? ? norm=None,
? ? ?? ? ? ? ? ?vmin=None,
? ? ? ? ? ? ? ? vmax=None,
? ? ? ? ? ? ? ? alpha=None,
? ? ? ? ? ? ? ? linewidths=None,
)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
?
x=np.random.randint(0,10,10)
y=np.random.randint(0,10,10)
print(x)
print(y)
plt.scatter(x,y,s=50)默認形狀圓點,顏色b 藍色,大小50
out:
[5 1 5 3 1 5 0 5 4 7]
[8 2 7 7 8 6 3 8 5 9]
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
x = np.array([[0,0],[0,1],[1,1],[3,2],[-2,3],[1,2],[4,3]])
print(x)
plt.scatter(x[:,0],x[:,1],marker='x',color='k',s=20)#點的形狀x,顏色黑色,大小20
?out:
[[ 0 ?0]
?[ 0 ?1]
?[ 1 ?1]
?[ 3 ?2]
?[-2 ?3]
?[ 1 ?2]
?[ 4 ?3]]
原文鏈接:https://blog.csdn.net/weixin_52797843/article/details/124419676
相關推薦
- 2022-04-03 用Python實現控制電腦鼠標_python
- 2022-05-05 Python學習之字典的常用方法總結_python
- 2023-06-19 Linux下使用Shell腳本實現進程監控的流程_linux shell
- 2022-03-30 帶你了解Python妙開根號的三種方式_python
- 2022-12-26 Golang判斷struct/slice/map是否相等以及對比的方法總結_Golang
- 2021-12-17 C++基礎概念講述_C 語言
- 2022-05-12 Python中賦值運算符的含義與使用方法_python
- 2022-11-27 通過源碼分析Golang?cron的實現原理_Golang
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支