
pgfplots
다음과 같은 빗 모양을 만드는 데 사용하고 있습니다 .
\documentclass{article}
\usepackage{pgfplots}
\usepackage{xcolor}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
\addplot+[ycomb,color=black] plot coordinates
{(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
기본 색상을 파란색에서 검정색으로 변경하고 싶습니다. 그러나 위의 코드는 빗 위쪽에 있는 원의 외부 경계만 변경하고 채워진 색상은 여전히 파란색입니다. 내부 색상 바꾸는 방법 아시는 분 계신가요?
답변1
빗 끝은 다음을 통해 형식을 지정할 수 있는 마커입니다.mark options
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
\addplot+[ycomb,mark options={black}] plot coordinates
{(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}