3 열이있는 데이터 테이블이 있는데,이 테이블은 다채로운 2D 플롯의 첫 번째 열을 기준으로 세 번째 열을 플롯합니다.플롯의 원점 변경
x,y,z = np.loadtxt('output_overlap.dat').T #Transposed for easier unpacking
nrows, ncols = final_step_j-1, final_step_k-1
grid = z.reshape((nrows, ncols))
plt.imshow(grid, extent=(x.min(), x.max(), y.max(), y.min()),
interpolation='nearest',
cmap='binary')
fig1 = plt.gcf()
plt.colorbar()
plt.xlabel('m1')
plt.ylabel('m2')
plt.draw()
fig1.savefig('test.pdf', dpi=100)
close('all')
나에게 다음과 같은 플롯을 제공합니다 : 올 https://dl.dropboxusercontent.com/u/31460244/test.png
다음 표 즉
4.0 4.0 0.313660827978
4.0 5.0 0.365348418405
4.0 6.0 0.423733120134
5.0 4.0 0.365348418405
5.0 5.0 0.439599930621
5.0 6.0 0.525083754405
6.0 4.0 0.423733120134
6.0 5.0 0.525083754405
6.0 6.0 0.651536351379
에 대한 예를 들어 다음 코드를 사용합니다. 이제 제 질문은 Y 축에서 데이터를 표시하는 순서를 어떻게 바꿀 수 있습니까? 나는 원점에 요점 (4,4)을 갖고 싶다.
I가
plt.imshow(grid, extent=(x.min(), x.max(), y.max(), y.min())
변경 시도 : 그것은 그리드의 숫자가 아니라 실제 데이터를 변경 않습니다
plt.imshow(grid, extent=(x.min(), x.max(), y.min(), y.max())
. 이것은 해결책이 아닙니다. 아무도 나 한테 도움을 줄 수 없어?
imshow에 원점 = 'lower'를 추가하면 완벽하게 작동합니다. 감사! – Rotail