
ご覧のとおり、2 番目の軸を上にシフトしました。ただし、ゼロは y 軸から切断されているため、修正したいと思います。
\begin{tikzpicture}[scale=1.5]
\begin{axis}[
date coordinates in=x,
width=12cm,height=5.5cm, scale only axis,
xticklabel style={align=center, rotate=90, anchor=near xticklabel},
major x tick style = transparent,
ymin=0,
ymax=6,
ytick={0,1,2,3,4,5}
]
\end{axis}
\begin{axis}[
yshift=7cm,
anchor=north west,
width=12cm,height=1.5cm, scale only axis,major x tick style = transparent,
minor x tick num = 0,
xticklabels={,,}]
\end{axis}
\end{tikzpicture}
答え1
少なくとも 2 番目の軸の y 下限を修正する、ymin=0
つまり軸に追加する必要があると思われます。
両方の軸が空の場合、次のような警告が表示されることがあります。
! Package pgfplots Warning: You have an axis with empty range. Replacing it with a default range and clearing all plots.
この場合、影響を受ける軸のすべての制限を手動で指定する必要があります。