答案1
正如我在评论中提到的,scale only axis=true
只设置轴的长度,而不是整个图片。
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc, intersections}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
name=a,
width=8cm,
height=8cm,
scale=1,
]
\addplot[
blue,
mark=*,
fill=blue,
] coordinates {
(0,0)
(1,1)
};
\end{axis}
\draw[orange, densely dashed] (0,-0.25) -- (8,-0.25);
\begin{axis}[
at={($(a.south west) - (0,0.5cm)$)},
anchor=north west,
scale only axis=true,
width=8cm,
height=8cm,
]
\addplot[
blue,
mark=*,
fill=blue,
] coordinates {
(0,0)
(1,1)
};
\end{axis}
\end{tikzpicture}
\end{document}
橙色线表示宽度为8厘米。