수직축을 최대값보다 1.0 높게, 최소값보다 1.0 낮게(암시적) 갖고 싶습니다. 그것은 enlarge y limits
일을 할 것이지만 그렇지 않습니다. 이 기능이 실제로 어떻게 작동하는지, 그리고 이것이 내 문제를 해결하는 올바른 접근 방식인지 잘 모르겠습니다.
내 MWE의 수직 범위는 2에서 7 사이이므로 수직 축을 1에서 8 사이로 설정하고 싶습니다. 표시된 값은 암시적입니다. 그래서 대답이 아닙니다 ymin=1
.ymax=8
여기 내 MWE가 있습니다
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usepackage{csvsimple}
\usepackage{filecontents}
\begin{filecontents*}{data.csv}
x,value
0, 3
5, 6
14, 7
31, 2
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\centering
\begin{axis}[
enlarge y limits = 1
]
\addplot table [x=x, y=value, col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}
\end{document}
답변1
기본적으로 매뉴얼(2.xx 버전 매뉴얼의 4.14장, 273페이지)에서 볼 수 있듯이 상대적으로 확대됩니다.
/pgfplots/enlarge y limits=auto|true|false|upper|lower| val |value=val |abs value= val | abs= val |rel= val (initially auto)
따라서 enlarge y limits = 1
y축의 한계를 100% 확대합니다. 아마도 10% 확대 또는 유사한 값으로 원하는 것을 얻을 수 있을 것입니다
enlarge y limits = 0.1
.
고정된 값으로 확대하려면 다음을 수행해야 합니다.
enlarge y limits={abs=1}
얻기 위해: