문제

I do not understand why I cannot get x and y axes show up in both figures. I would like numbers and ticks in the main figure and subfigure. Please find below the code I've used.

# Main Plot  
plt.axes([.1, .1, .8, .8])
plt.xticks(())
plt.yticks(())
plt.xlabel("Period")
plt.ylabel("Chi")
plt.minorticks_on()
plt.plot(period, chi, 'bo', markersize = 0.5)
# Subplot 
plt.axes([.5, .2, .3, .3])
plt.xticks(())
plt.yticks(())
plt.xlim(3.27, 3.3)
plt.ylim(2,4)
plt.plot(period, chi, 'bo', markersize = 0.5)
plt.savefig("test_fig.jpg", dpi=200)

enter image description here

도움이 되었습니까?

해결책

When you do:

plt.xticks(())
plt.yticks(())

you are removing the ticks by setting them to an empty sequence.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top