I want to have three horizontal axis and for each axis the ticks and labels should be right next to their respective axis.
My attempt:
import matplotlib.pyplot as plt
import numpy as np
T = range(30,60)
Q1 = range(100,400,10)
fig = plt.figure(figsize=(5,5))
fig.subplots_adjust(top=0.8)
axs = fig.subplots(1,1)
axs.set_xlabel('xaxis a')
axs.set_ylabel('ylabel')
axs.plot(T,Q1,c='k')
ax2 = axs.twiny()
ax2.set_xlim(min(T)+273.15,max(T)+273.15)
ax2.set_xlabel('xaxis b')
ax3 = axs.twiny()
ax3.spines["bottom"].set_position(("axes",-.3))
ax3.set_xlim(min(T)-T_amb,max(T)-T_amb)
ax3.set_xlabel('xaxis c')
This works well for the second xaxis and for the line of the third axis, but the ticks and label of the third axis are right where the ticks and label of the second xaxis are, not together with the third xaxis.
Here is the current plot:
Thanks in advance!