나는 아래의 멋진 hexbin plot을 가지고있다. 그러나 Aitoff 투영으로 hexbin을 얻는 방법이 있는지 궁금하다. 분출하는 코드는 다음과 같습니다matlotlib hexbin을 Aitoff 투영에 넣기
import numpy as np
import math
import matplotlib.pyplot as plt
from astropy.io import ascii
filename = 'WISE_W4SNRge3_and_W4MPRO_lt_6.0_RADecl_nohdr.dat'
datafile= path+filename
data = ascii.read(datafile)
points = np.array([data['ra'], data['dec']])
color_map = plt.cm.Spectral_r
points = np.array([data['ra'], data['dec']])
xbnds = np.array([ 0.0,360.0])
ybnds = np.array([-90.0,90.0])
extent = [xbnds[0],xbnds[1],ybnds[0],ybnds[1]]
fig = plt.figure(figsize=(6, 4))
ax = fig.add_subplot(111)
x, y = points
gsize = 45
image = plt.hexbin(x,y,cmap=color_map,
gridsize=gsize,extent=extent,mincnt=1,bins='log')
counts = image.get_array()
ncnts = np.count_nonzero(np.power(10,counts))
verts = image.get_offsets()
ax.set_xlim(xbnds)
ax.set_ylim(ybnds)
plt.xlabel('R.A.')
plt.ylabel(r'Decl.')
plt.grid(True)
cb = plt.colorbar(image, spacing='uniform', extend='max')
plt.show()
나는 시도했다 : 만 좋은하지만, 빈, Aitoff 그리드를 제공
plt.subplot(111, projection="aitoff")
되는 plt.hexbin
명령을 수행하기 전에,하지만.
어떤 투사의'hexbin' 플롯을 플롯의 문제가없는 준다 : 당신이 원하는 것을 얻기 위해 다음과 같이
당신은 당신의 코드를 변경할 수 있습니다. [mcve]가 없으면 아무도 문제가있는 곳을 알 수 없습니다. – ImportanceOfBeingErnest
(잘하면) 최소한의 완전한 코드입니다. 위와 같이 RA/Decl 또는 x, y 데이터 포인트는 단지 numpy 배열 일 수 있습니다. – npross
기본적으로 Aitoff 투영에 사용되는 hexbin을 찾을 수있는 예제가 없으므로 "투영법에서 hexbin 음모를 그리는 것만 큼 쉽지는 않다고 생각합니다." – npross