다음 MWE를 사용하면(를 사용하여 기호 좌표로 막대 차트를 플롯하려고 함 pgfplots
) 수정 방법을 모르는 오류가 발생합니다.
Package pgfplots Warning: You have an axis with empty range (in direction x)
MWE:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
% axis on top,
axis lines*=left,
ymajorgrids,
ybar,
ymin=0, ymax=2000,
xtick=data,
ytick = {0,200,400,600,800,1000,1200,1400,1600,1800},
bar width=0.1cm,
enlarge x limits=0.15,
enlarge y limits={upper, value=0.1},
x tick label style={font=\footnotesize,align=right,rotate=90},
symbolic x coords={jan12,feb12,mar12,apr12,may12,jun12,jul12,aug12,sep12,oct12,nov12,dec12
jan-13,feb-13,mar-13,apr-13,may-13,jun-13,jul-13,aug-13,sep-13,oct-13,nov-13,dec-13},
]
\end{axis}
\end{tikzpicture}
\end{document}
답변1
메시지는경고, 오류가 아닙니다.
이를 방지하려면 , 에 적절한 값을 제공 하십시오 xmin
. xmax
또한 다음 뒤에 쉼표가 누락되었습니다 dec12
.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
% axis on top,
axis lines*=left,
ymajorgrids,
ybar,
ymin=0, ymax=2000,
xmin=jan12, xmax=dec-13,
xtick=data,
ytick = {0,200,400,600,800,1000,1200,1400,1600,1800},
bar width=0.1cm,
enlarge x limits=0.15,
enlarge y limits={upper, value=0.1},
x tick label style={font=\footnotesize,align=right,rotate=90},
symbolic x coords={jan12,feb12,mar12,apr12,may12,jun12,jul12,aug12,sep12,oct12,nov12,dec12,
jan-13,feb-13,mar-13,apr-13,may-13,jun-13,jul-13,aug-13,sep-13,oct-13,nov-13,dec-13},
]
\end{axis}
\end{tikzpicture}
\end{document}