Python Data Visualization

python 上面有不少数据可视化的工具包,先利用这篇文章总结如下:

  • ggplot
  • Seaborn
  • Bokeh
  • Pygal
  • python-igraph
  • folium
  • Network
  • XMayavi
  • VisPy
  • PyQtGraph
  • vincent
  • Plotly

seaborn是偏向于统计作图的,尤其是线性作图,用起来比较顺手,简单。seaborn整个语法层也会简化很多,画出的图不需要修饰看起来也很好看。但是绘图方式有限,不够灵活

bokeh是使用了js。因此主打的是交互式绘图,你可以在Ipython notebook里使用到最佳!画出的图非常好看,关键是可以交互修改! 缺点是语法有点生涩,一点也不必matplotlib简单

ggplot就算了吧,和R语言那个GGPLOT2比起来,简直是感觉在用两个包,似然都是同一个人开发的! 而且原作者也在GITHUB上说了,不再会更新PYTHON的库! 不过话说,ggplot2真的是绘图神器,这几乎是我还在用R语言的唯一原因。

python for map data visualization

folium no doubt

javascript library : http://kartograph.org/
dynamic visualization : https://github.com/areski/python-nvd3
https://github.com/wrobstory/bearcart

以下是folium 作者的回复
Vincent is really meant for static visualization, unfortunately. If you’re interested in dynamic vis, take a look at python NVD3: https://github.com/areski/python-nvd3

or my other lib, Bearcart:

https://github.com/wrobstory/bearcart

I might put in a little work this weekend to integrate it more tightly with the ipython notebook.

If you’re looking for interactive D3 libs that are easy to work with, I highly recommend Dimple as well:

http://dimplejs.org/

matplotlib draw animate graph

1
2
3
4
5
6
7
8
9
10
import numpy as np
import matplotlib.pyplot as plt

plt.axis([0, 100, 0, 1])
plt.ion()

for i in range(100):
y = np.random.random()
plt.scatter(i, y)
plt.pause(0.1)

Source for map visualization

how to get geoJson Data
from shapefile to geoJson
lets make a map
gadm world shapefile download
mapshaper
topoJson