http://stackoverflow.com/questions/20105364/how-can-i-make-a-scatter-plot-colored-by-density-in-matplotlib
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
# Generate fake data
x = np.random.normal(size=1000)
y = x * 3 + np.random.normal(size=1000)
# Calculate the point density
xy = np.vstack([x,y])
z = gaussian_kde(xy)(xy)
# Sort the points by density, so that the densest points are plotted last
idx = z.argsort()
x, y, z = x[idx], y[idx], z[idx]
fig, ax = plt.subplots()
ax.scatter(x, y, c=z, s=50, edgecolor='')
plt.show()
'생물정보학 > Useful PAGEs' 카테고리의 다른 글
How to remove particular species from nr db of NCBI? (0) | 2017.08.09 |
---|---|
DomainDraw: 단백질 서열 batch로 그리기 (0) | 2017.08.09 |
CoBaltDB: Prokaryotic localization tools and databases (0) | 2016.03.28 |
Samtools: 원하는 부분의 파스타 파일 자르기 (0) | 2016.03.21 |
Bedtools: Intergenic region 찾기 (0) | 2016.02.22 |