
図の上部にある小さな目盛り (小さな灰色のもの) を削除し、X 軸に沿ってはそのまま残す方法を探しています。コードは次のとおりです。
\begin{figure}[h]
\caption{Distribution of visitor}
\label{DistributionFirmVisitors}
\begin{center}
\begin{tikzpicture}
\begin{axis}[width=10cm,height=7cm,
ylabel={\% of EDGAR visitors},
xmin=1,
xmax=200,
ymin=0.3,
ymax=1,
xtick={1, 25, 50, 75, 100, 125, 150, 175, 200},
ytick={0.3,0.4,0.5,0.6,0.7,0.8,0.9,1},
xticklabel style={/pgf/number format/1000 sep=,rotate=60,anchor=east,font=\normalsize},
tick label style={/pgf/number
format/precision=5},
scaled y ticks = false,
legend pos=north east,
ymajorgrids=true,
grid style=dashed,
every axis plot/.append style={thick},
axis background/.style={fill=gray!5},
]
\addplot[
color=black,
]
coordinates {
(1, 0.1)
(25, 0.1)
(50,0.1)
(75,0.1)
(100, 0.1)
(200, 0.1)
};
\end{axis}
\end{tikzpicture} \\
\end{center}
\end{figure} \vspace{0.4cm}
答え1
あなたが探しているのは だと思いますxtick pos=lower
。
% used PGFPlots v1.16
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=10cm,
height=7cm,
ylabel={\% of EDGAR visitors},
xmin=1,
xmax=200,
ymin=0.3,
ymax=1,
xtick={1, 25, 50, 75, 100, 125, 150, 175, 200},
ytick={0.3,0.4,0.5,0.6,0.7,0.8,0.9,1},
xticklabel style={
rotate=60,
anchor=east,
font=\normalsize,
},
ymajorgrids=true,
grid style=dashed,
axis background/.style={fill=gray!5},
xtick pos=lower, % <-- added
]
% (because of y = 0.1 and `ymin=0.3` it is invisible anyway)
\addplot coordinates {(1,0.1)};
\end{axis}
\end{tikzpicture}
\end{document}