
아래 그림과 유사한 막대 그래프를 만들려고 하는데 x축 레이블이 $\ket{000}$
다음 과 같이 표시되므로 오류 없이 만드는 방법을 찾을 수 없어 문제가 있습니다.
아래는 내가 작업하려고하는 것입니다.
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Year,
enlargelimits=0.05,
legend style={at={(0.5,-0.1)},
anchor=north,legend columns=-1},
ybar interval=0.7,
]
\addplot
coordinates {($\ket{000}$,4) ($\ket{001}$,4)
($\ket{010}$,7) ($\ket{011}$,-5) ($\ket{100}$,3)};
\end{axis}
\end{tikzpicture}
답변1
이 같은?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{braket}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
x tick label style={/pgf/number format/1000 sep=},
ylabel=Year,
enlargelimits=0.05,
legend style={at={(0.5,-0.1)},anchor=north,legend columns=-1},
ybar interval=0.7,
symbolic x coords = {$\ket{000}$, $\ket{001}$, $\ket{010}$, $\ket{011}$, $\ket{100}$, 6}
]
\addplot
coordinates {($\ket{000}$,4) ($\ket{001}$,4) ($\ket{010}$,7) ($\ket{011}$,-5) ($\ket{100}$,3) (6,3)};
\end{axis}
\end{tikzpicture}
\end{document}