Question

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

Was it helpful?

Solution

When you do:

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top