2016-08-15 22 views
-1

私は1つのヘックスビングラフを持っていますが、このグラフに他の点(2点(x1、y1)など)を追加する方法はありますか?Pythonで六角形グラフの点をプロットする方法は?

おかげ

x=log(PR) 
y=log(CR) 

xmin = x.min() 
xmax = x.max() 
ymin = y.min() 
ymax = y.max() 

x1=log(np.array([10,20])) 
y1=log(np.array([10,20])) 
plt.hexbin(x1, y1, bins='log',color='red') 
plt.hexbin(x, y, bins='log', cmap=plt.cm.gist_ncar) 
plt.axis([xmin, xmax, ymin, ymax]) 
plt.title("With a log color scale") 
cb = plt.colorbar() 
cb.set_label('log10(N)') 
plt.show() 

答えて

0

プロットするものに応じて、いくつかの方法があります。いくつかの例:

import matplotlib.pylab as pl 
import numpy as np 

x=np.random.random(1000) 
y=np.random.random(1000) 

pl.figure() 
pl.hexbin(x, y, gridsize=5, cmap=pl.cm.PuBu_r) 
pl.scatter(0.2, 0.2, s=400) 
pl.text(0.5, 0.5, 'a simple text') 
pl.text(0.6, 0.6, 'an aligned text', va='center', ha='center') 
pl.annotate("an annotation for that scatter point", (0.2, 0.2), (0.3, 0.3),\ 
    arrowprops=dict(facecolor='black', shrink=0.05)) 

enter image description here

関連する問題