グループプロットでシンボリック x 座標を使用しています。 を失うことなく上部のプロットの目盛りと目盛りラベルを無効にすることができないため、問題が発生しますxmajorgrid
。これに対する適切なオプションが見つからないようです。
最後の行を除くすべてのプロットの目盛りラベルのみを無効にするにはどうすればよいですか? (この場合、1 つのプロット/1 つの列のみ)
pgfplots タグをフォローしている皆さんへのちょっとしたメモ: たくさんの質問をして申し訳ありません。この点に関しては、私は非常に呪われているようです。つまり、多くの小さなことがうまく機能せず、問題を回避することができないのです。
写真
ムウェ
\documentclass[
a4paper
]{scrartcl}
\usepackage{
amsmath,
tikz,
pgfplots,
}
\usepgfplotslibrary{
groupplots,
}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{center}
\begin{tikzpicture}[font=\small]
\begin{groupplot}[
group style={
group size=1 by 3, %Spalte(n) by Zeile(n)
horizontal sep=0cm,
vertical sep=0.2cm,
xlabels at=edge bottom,
yticklabels at=edge bottom,
ylabels at=edge left,
yticklabels at=edge left,
},
%
ymin=0, ymax=30,
%
xlabel={Bla},
ylabel={Process},
%
xmajorgrids=true,
%
scale ticks above exponent={3},
]
\nextgroupplot[
xmin=10, xmax=20,
]
\addplot coordinates{(11,12) (13,15)};
\nextgroupplot[
symbolic x coords={11,13},
xtick=\empty,
]
\addplot[red, dashed] coordinates{(11,8) (13,25)};
\nextgroupplot[
xmin=10, xmax=20,
]
\addplot[orange, thick] coordinates{(11,8) (13,25)};
\end{groupplot}
\end{tikzpicture}
\end{center}
\end{document}
答え1
回避策
これまで私が見つけた最良の治療法は を使うことですx tick label style={color=white},
。 s の位置によってはかなりうまく機能しますxticklabel
。
かなり満足度の低い回避策は、\draw[thin, gray] (rel axis cs:0.33,0) -- (rel axis cs:0.33,1);
グリッドを描画するための と、目盛りを描画するためのそれぞれのコマンドのようなものを使用することです。これには、多くの T&E 実行が必要になる可能性があります。
\documentclass[
a4paper
]{scrartcl}
\usepackage{
amsmath,
tikz,
pgfplots,
}
\usepgfplotslibrary{
groupplots,
}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{center}
\begin{tikzpicture}[font=\small]
\begin{groupplot}[
group style={
group size=1 by 3, %col(s) by row(s)
horizontal sep=0cm,
vertical sep=0.2cm,
xlabels at=edge bottom,
yticklabels at=edge bottom,
ylabels at=edge left,
yticklabels at=edge left,
},
%
ymin=0, ymax=30,
%
xlabel={Bla},
ylabel={Process},
%
xmajorgrids=true,
%
scale ticks above exponent={3},
]
\nextgroupplot[
xmin=10, xmax=20,
]
\addplot coordinates{(11,12) (13,15)};
\nextgroupplot[
symbolic x coords={11,13},
%xtick=\empty,
x tick label style={color=white}, %<-------------- WORKAROUND HERE
]
\addplot[red, dashed] coordinates{(11,8) (13,25)};
\nextgroupplot[
xmin=10, xmax=20,
]
\addplot[orange, thick] coordinates{(11,8) (13,25)};
\end{groupplot}
\end{tikzpicture}
\end{center}
\end{document}