- 我
xbar chart
在 中生成一个pgfplots
。
- 我指定了
extra x ticks
但是我不需要其他的xticks
。
xtick = \empty
作品。
xtick = {}
不起作用。
- 这是预期的行为吗?
\documentclass[border=5mm,tikz]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xbar,
symbolic y coords = {A,B,C,D,E},
enlarge y limits = 0.15,
ytick = data,
width = 160mm,
height = 90mm,
xmin = 0,
xmax = 10,
extra x ticks={1},
xtick = \empty,
title = {\texttt{xtick = \textbackslash empty}},
]
\addplot[fill=green] coordinates {(1,A) (2,B) (3,C) (4,D) (9,E)};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
xbar,
symbolic y coords = {A,B,C,D,E},
enlarge y limits = 0.15,
ytick = data,
width = 160mm,
height = 90mm,
xmin = 0,
xmax = 10,
extra x ticks={1},
xtick = {},
title = {\texttt{xtick = \{\}}},
]
\addplot[fill=green] coordinates {(1,A) (2,B) (3,C) (4,D) (9,E)};
\end{axis}
\end{tikzpicture}
\end{document}