1
을 pyplot . 축이 보이지 않으면 레이블이 표시되지 않으므로 축 레이블로 시도한 모든 항목이 실패합니다.하기 matplotlib 색상 코딩 지점이 위도/경도 산포도에서 2D 분산없이 축 추가, 공유 축 레이블
이러한 오류가없는 작업 코드는 아래와 같습니다. 축 테두리, 라벨의 표시 점과 ticklabels :
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("_test.csv")
power = df['n']
lat = df['latitude']
lon = df['longitude']
df = pd.read_csv("shifted3.csv")
power = df['n']
lat = df['latitude']
lon = df['longitude']
plt.subplot(121)
plt.scatter(lon, lat, c=power,s=65, vmin=0, vmax=3700)
# c= sets how the points are coloured, s= point size, vmin/max colour lims
plt.title('a) AGW')
plt.ylim(ymin=51.44,ymax=51.73)
plt.xlim(xmin=1.42, xmax=1.63)
plt.axis('off')
cbar = plt.colorbar()
cbar.ax.set_yticklabels(['0','','','','','','','','','3600'])
plt.subplot(122)
#plt.figure(figsize=(5,10))
plt.scatter(lon, lat, c=power,s=65, vmin=0, vmax=3700)
# c= sets how the points are coloured, s= point size, vmin/max colour lims
plt.title('b) no event')
plt.xlim(xmin=2.23, xmax=2.45)
plt.ylim(ymax=52.09)
plt.axis('off')
# #
cbar = plt.colorbar()
cbar.ax.set_yticklabels(['0','','800','','1600','','2400','','','3600'])
cbar.set_label('Power (kW)', rotation=270, labelpad=+12)
#labelpad + moves legend to right, - to left
plt.show()
을 제공, 모두 함께이 퍼팅? http://stackoverflow.com/questions/29041326/3d-plot-with-matplotlib-hide-axes-but-keep-axis-labels – periphreal
정말 달성하고자하는 것을 이해하기가 어렵습니다. "나는 축을 갖고 싶지 않습니다."- 당신이 보여주는 플롯은 축을 가지고 있지 않습니다. "...하지만 x 축과 y 축에 공유 레이블이 있습니다"x와 y는 어떻게 레이블을 공유합니까? 그 라벨은 어디에 앉을까요? – ImportanceOfBeingErnest
사과 @ImportanceOfBeingErnest, 나는 서브 플로트 아래에 공유 된 x 레이블과 두 개의 플롯의 왼쪽에 하나의 y 축을 의미했습니다. –