x축에 대해 두 개의 라벨 중 하나만 인쇄

x축에 대해 두 개의 라벨 중 하나만 인쇄

다음 tiki 코드(matlab에서 생성됨)는 훌륭하게 인쇄되지만 x 레이블은 두 개 중 하나만 인쇄하고 싶습니다. 즉, 인쇄하는 대신 다음을 수행합니다.

10^−14 10^−13 10^−12 10^−11 10^−10 10^−9 10^−8 10^−7 10^−6 10^−5 10^−4

인쇄하고 싶습니다:

10^−1 10^−1 10^−10 10^−8 10^−6 10^−4

pff/tikz 매뉴얼을 검색했지만 아무것도 찾지 못했습니다.

\begin{tikzpicture}

\begin{axis}[%
width=3.149in,
height=2.649in,
at={(0.594in,0.521in)},
scale only axis,
separate axis lines,
every outer x axis line/.append style={black},
every x tick label/.append style={font=\color{black}},
every x tick/.append style={black},
xmode=log,
xmin=1e-14,
xmax=1e-4,
xminorticks=true,minor
xlabel={\large{\Lobj}},
every outer y axis line/.append style={black},
every y tick label/.append style={font=\color{black}},
every y tick/.append style={black},
ymin=50,
ymax=250,
ylabel={\large{\Cmax}},
axis background/.style={fill=white},
% title={lambda:Cmax}
]
\addplot [color=blue, line width=1.0pt, forget plot]
  table[row sep=crcr]{%
9e-05   59\\
7e-05   59\\
5e-05   59\\
3e-05   64\\
1e-05   99\\
7e-06   107\\
2e-06   138\\
1e-06   141\\
7e-07   159\\
5e-07   165\\
3e-07   166\\
7e-09   168\\
5e-10   185\\
4e-10   193\\
5e-11   202\\
5e-12   228\\
5e-13   237\\
1e-14   240\\
};
\end{axis}
\end{tikzpicture}%

답변1

xticklabelx축의 눈금 라벨 정의를 변경하는 데 사용할 수 있습니다 .

xticklabel={%
  \pgfmathMod{\ticknum}{2}%
  \ifdim \pgfmathresult pt >0pt\axisdefaultticklabellog\fi
}

여기에 이미지 설명을 입력하세요

암호:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
width=3.149in,
height=2.649in,
at={(0.594in,0.521in)},
scale only axis,
separate axis lines,
every outer x axis line/.append style={black},
every x tick label/.append style={font=\color{black}},
every x tick/.append style={black},
xmode=log,
xmin=1e-14,
xmax=1e-4,
xminorticks=true,
xlabel={x Text},
every outer y axis line/.append style={black},
every y tick label/.append style={font=\color{black}},
every y tick/.append style={black},
ymin=50,
ymax=250,
ylabel={y Text},
axis background/.style={fill=white},
label style={font=\large},
xticklabel={%
  \pgfmathMod{\ticknum}{2}%
  \ifdim \pgfmathresult pt >0pt\axisdefaultticklabellog\fi
},
% title={lambda:Cmax}
]
\addplot [color=blue, line width=1.0pt, forget plot]
  table[row sep=crcr]{%
9e-05   59\\
7e-05   59\\
5e-05   59\\
3e-05   64\\
1e-05   99\\
7e-06   107\\
2e-06   138\\
1e-06   141\\
7e-07   159\\
5e-07   165\\
3e-07   166\\
7e-09   168\\
5e-10   185\\
4e-10   193\\
5e-11   202\\
5e-12   228\\
5e-13   237\\
1e-14   240\\
};
\end{axis}
\end{tikzpicture}%
\end{document}

관련 정보