- 本網站根據資料格式、資料之間關系將圖表分類,讓您快速挑選可能的圖形;
關注公眾號“pythonic生物人”,后臺回復prd即可獲取,
- 所有圖形提供一圖Python語言、R語言、D3.js三種實作方式【代碼全部免費提供】;
- 提供大量可視化tips;
- 網站作者為下面兩法國帥哥~~

目錄
資料格式&&資料之間關系 VS 圖表分類
一圖Python語言、R語言、D3.js三種實作方式【代碼全部免費提供】
大量可視化tips
網站網址
資料格式&&資料之間關系 VS 圖表分類
資料格式可分以下6類:

資料格式 VS圖表分類:
eg,Numeric且categoric類資料下各類圖表,

資料之間關系可分以下7類:

資料之間關系 VS 圖表分類:

一圖Python語言、R語言、D3.js三種實作方式【代碼全部免費提供】
點擊任意圖,出現如下三個按鈕,即是一圖三種實作方法源代碼~
同時介紹圖形的使用范圍、常犯錯誤、更多學習資料,

以圈圖為例:

Python實作
# python實作
import pandas as pd
import holoviews as hv
from holoviews import opts, dim
from bokeh.sampledata.les_mis import data
# data set
nodes = hv.Dataset(pd.DataFrame(data['nodes']), 'index')
# chord diagram
chord = hv.Chord((links, nodes)).select(value=(5, None))
chord.opts(
opts.Chord(cmap='Category20', edge_cmap='Category20', edge_color=dim('source').str(),
labels='name', node_color=dim('index').str()))

R實作
#R實作
library(circlize)
circos.clear()
#Create data
data = data.frame(
factor = sample(letters[1:8], 1000, replace = TRUE),
x = rnorm(1000),
y = runif(1000)
)
#Initialize the plot.
par(mar = c(1, 1, 1, 1) )
circos.initialize(factors = data$factor, x = data$x )
# Build the regions of track #1
circos.trackPlotRegion(factors = data$factor, y=data$y, panel.fun = function(x, y) {
circos.axis(labels.cex=0.5, labels.font=1, lwd=0.8)
})
# --> Add a scatterplot on it:
circos.trackPoints(data$factor, data$x, data$y, col = rgb(0.1,0.5,0.8,0.3), pch=20)
# Build the regions of track #2:
circlize::circos.trackPlotRegion(factors = data$factor, y=data$y, panel.fun = function(x, y) {
circos.axis(labels=FALSE, major.tick=FALSE)
})
# --> Add a scatterplot on it
circos.trackPoints(data$factor, data$x, data$y, col = rgb(0.9,0.5,0.8,0.3), pch=20, cex=2)
# Add track #3 --> don't forget you can custom the height of tracks!
circos.par("track.height" = 0.4)
circos.trackPlotRegion(factors = data$factor, y=data$y, panel.fun = function(x, y) {
circos.axis(labels=FALSE, major.tick=FALSE)
})
circos.trackLines(data$factor, data$x, data$y, col = rgb(0.9,0.5,0.1,0.3), pch=20, cex=2, type="h")
# and continue as long as needed!
D3.js實作
大量可視化tips

網站網址
關注公眾號“pythonic生物人”,后臺回復prd即可獲取,
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/286309.html
標籤:python
上一篇:神經網路之手寫數字識別
