简体   繁体   中英

axes labels and ticks in multiplots

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)

在此输入图像描述

When you do:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM