# 點圖 Scatter Chart,也叫 X-Y 圖,它將所有的數據以點的形式展現在笛卡爾坐標系上,以顯示變量之間的相互影響程度,點的位置由變量的數值決定。 # 基礎散點圖 通過觀察散點圖上數據點的分佈情況,我們可以推斷出變量間的相關性。如果變量之間不存在相互關係,那麼在散點圖上就會表現為隨機分佈的離散的點,如果存在某種相關性,那麼大部分的數據點就會相對密集並以某種趨勢呈現。數據的相關關係主要分為:正相關(兩個變量值同時增長)、負相關(一個變量值增加另一個變量值下降)、不相關、線性相關、指數相關等,表現在散點圖上的大致分佈如下圖所示。那些離點集群較遠的點我們稱為離群點或者異常點。 ### 預覽圖 --- #### [![散點圖.png](https://book.gosu.bar/uploads/images/gallery/2019-12/scaled-1680-/zZvNMsGjmY5IfvhX-%E6%95%A3%E9%BB%9E%E5%9C%96.png)](https://book.gosu.bar/uploads/images/gallery/2019-12/zZvNMsGjmY5IfvhX-%E6%95%A3%E9%BB%9E%E5%9C%96.png) ### 設定值 --- - #### 資料源 - [AntV](https://g2.antv.vision/zh/examples/point/scatter) ``` https://g2.antv.vision/zh/examples/data/scatter.json ( 資料來源:AntV ) 格式: [ {gender: "female",height: 161.2,weight: 51.6,}, {gender: "female",height: 167.5,weight: 59,}, ...... ] ``` - #### 內距 ``` 40, 40, 60, 60 ``` - #### 圖 Geom ##### 點圖(point)
列表設定值
欄位height\*weight
類型點圖
形狀circle
# 多色散點圖 ### 預覽圖 --- #### [![多色散點圖.png](https://book.gosu.bar/uploads/images/gallery/2019-12/scaled-1680-/9DBly2xi4KSosMXR-%E5%A4%9A%E8%89%B2%E6%95%A3%E9%BB%9E%E5%9C%96.png)](https://book.gosu.bar/uploads/images/gallery/2019-12/9DBly2xi4KSosMXR-%E5%A4%9A%E8%89%B2%E6%95%A3%E9%BB%9E%E5%9C%96.png) ### 設定值 --- - #### 資料源 - [AntV](https://g2.antv.vision/zh/examples/point/scatter) ``` https://g2.antv.vision/zh/examples/data/scatter.json ( 資料來源:AntV ) 格式: [ {gender: "female",height: 161.2,weight: 51.6,}, {gender: "female",height: 167.5,weight: 59,}, ...... ] ``` - #### 內距 ``` 40, 40, 60, 60 ``` - #### 圖 Geom ##### 點圖(point)
列表設定值
欄位height\*weight
類型點圖
顏色欄位gender
形狀參數circle
大小參數4
# 多形多色散點圖 ### 預覽圖 --- #### [![多形多色散點圖.PNG](https://book.gosu.bar/uploads/images/gallery/2019-12/scaled-1680-/GpX94sqLDSRTRbeB-%E5%A4%9A%E5%BD%A2%E5%A4%9A%E8%89%B2%E6%95%A3%E9%BB%9E%E5%9C%96.PNG)](https://book.gosu.bar/uploads/images/gallery/2019-12/GpX94sqLDSRTRbeB-%E5%A4%9A%E5%BD%A2%E5%A4%9A%E8%89%B2%E6%95%A3%E9%BB%9E%E5%9C%96.PNG) ### 設定值 --- - #### 資料源 - [AntV](https://g2.antv.vision/zh/examples/point/scatter) ``` https://g2.antv.vision/zh/examples/data/scatter.json ( 資料來源:AntV ) 格式: [ {gender: "female",height: 161.2,weight: 51.6,}, {gender: "female",height: 167.5,weight: 59,}, ...... ] ``` - #### 內距 ``` 40, 40, 60, 60 ``` - #### 圖 Geom ##### 點圖(point)
列表設定值
欄位height\*weight
類型點圖
顏色欄位gender
形狀gender
形狀參數circle,diamond
大小參數4
# 擾動點圖

圖片僅供參考,此點圖會浮動

### 預覽圖 --- #### [![擾動點圖.png](https://book.gosu.bar/uploads/images/gallery/2019-12/scaled-1680-/bJSD39bNrWXH0VzB-%E6%93%BE%E5%8B%95%E9%BB%9E%E5%9C%96.png)](https://book.gosu.bar/uploads/images/gallery/2019-12/bJSD39bNrWXH0VzB-%E6%93%BE%E5%8B%95%E9%BB%9E%E5%9C%96.png) ### 設定值 --- - #### 資料源 - [AntV](https://g2.antv.vision/zh/examples/point/scatter#jitter) ``` https://g2.antv.vision/zh/examples/data/dv-grades.json ( 資料來源:AntV ) 格式: [ {Class: "Summer 2013",Grade: "C",Score: 72.5,}, {Class: "Summer 2013",Grade: "C",Score: 77.5,}, ...... ] ``` - #### 內距 ``` 40, 40, 60, 60 ``` - #### 比例尺 Scale ##### Class(X軸)
列表設定值
欄位Class
類型cat
刻度數量5
優化數據範圍開啟
- #### 軸座標 Axis ##### Score( X軸 )
列表設定值
欄位Score
啟用開啟
位置left
##### Class( Y軸 )
列表設定值
欄位Class
啟用開啟
刻度現 - 顏色\#A14242
次要刻度 - 數量2
次要刻度 - 顏色\#A14242
- #### 圖 Geom ##### 點圖(point)
列表設定值
欄位Class\*Score
類型點圖
顏色欄位Grade
形狀circle
大小參數4
調整欄位擾動 | Jitter
- #### 圖示 Legend
列表設定值
啟用開啟
欄位Class
位置
排版水平
# 氣泡圖

圖片僅供參考,此點圖會浮動

### 預覽圖 --- #### [![氣泡圖.png](https://book.gosu.bar/uploads/images/gallery/2019-12/scaled-1680-/gpgc3kbeGTaRRHRY-%E6%B0%A3%E6%B3%A1%E5%9C%96.png)](https://book.gosu.bar/uploads/images/gallery/2019-12/gpgc3kbeGTaRRHRY-%E6%B0%A3%E6%B3%A1%E5%9C%96.png) ### 設定值 --- - #### 資料源 - [AntV](https://g2.antv.vision/zh/examples/point/scatter#bubble) ``` https://g2.antv.vision/zh/examples/data/bubble.json ( 資料來源:AntV ) 格式: [ {continent: "Americas",Country: "Argentina",LifeExpectancy: 75.32,GDP: 12779.37964,Population: 40301927,}, {continent: "Americas",Country: "Brazil",LifeExpectancy: 72.39,GDP: 9065.800825,Population: 190010647,}, ...... ] ``` - #### 內距 ``` 40, 40, 60, 60 ``` - #### 比例尺 Scale ##### GDP(X軸)
列表設定值
欄位GDP
類型linear
優化數據範圍開啟
最小值0
格式化函數``` function formatter(value) {

return (value / 1000).toFixed(0) + 'k';

} ```
- #### 圖 Geom ##### 點圖(point)
列表設定值
欄位GDP\*LifeExpectancy
類型點圖
顏色欄位continent
形狀circle
大小欄位Population
大小參數4,65
調整欄位擾動 | Jitter
- #### 圖示 Legend
列表設定值
啟用開啟
欄位Population
位置
排版水平
水平偏移量140
水平間距80