網站首頁 編程語言 正文
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-14 教你用python將數據寫入Excel文件中_python
- 2022-08-25 Python??中的pass語句語法詳析_python
- 2022-06-18 Python周期任務神器之Schedule模塊使用詳解_python
- 2022-05-12 Kotlin flatMap 高級函數 操作數組的數組
- 2022-06-06 CZGL.ProcessMetrics處理監控數據的三種方式介紹_實用技巧
- 2022-04-09 Linux(CentOS7)后臺運行程序關掉窗口不被殺掉
- 2022-07-04 Python迭代器的實現原理_python
- 2023-08-28 React綁定antd輸入框,點擊清空或者確定按鈕實現清空輸入框內容
- 最近更新
-
- 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同步修改后的遠程分支