ax1 = fig.add_subplot(111)
ax2 = ax1.twiny()
X2tick_location = ax1.xaxis.get_ticklocs()
ax2.set_xticks(X2tick_location)
ax2.set_xticklabels(X2tick_location)
plt.show()
how to show tick labels on top of matplotlib plot?