我尝试将图像作为 xy 平面包含在 z=0 上。请参阅 mwe。
ymax 应该是 1500。但是当我将 ymax 改为 1500,将范围(axis cs:7.5,75,0) coordinate (P)
改为(axis cs:7.5,750,0) coordinate (P)
和[width = 15cm, height = 150cm]
改为 时[width = 15cm, height = 1500cm]
,出现错误,提示尺寸太大。
有没有解决方案,这样我就不必写成time/10
ylabel 了?
包含图像的方法基于这问题。
梅威瑟:
\documentclass{standalone}
\usepackage{mwe}
\usepackage{pgfplots}
\usetikzlibrary{3d,calc}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid,
enlargelimits = false,
xmin = 0,
xmax = 15,
ymin = 0,
ymax = 150, % ymax should be 1500
restrict x to domain*=0:15,
restrict y to domain*=0:150, % see above
zmin = -300,
zmax = 0,
ylabel = {Time / 10},
xlabel = {x},
zlabel = {},
view={-30}{40},
]
\path (axis cs:0,0,0) coordinate (O) (axis cs:1,0,0) coordinate (X)
(axis cs:0,1,0) coordinate (Y) (axis cs:0,0,1) coordinate (Z)
(axis cs:7.5,75,0) coordinate (P)
[x={($(X)-(O)$)},y={($(Y)-(O)$)},z={($(Z)-(O)$)},
canvas is xy plane at z=0,transform shape]
(P) node{\includegraphics[width = 15cm, height = 150cm]{example-image-a}};
\end{axis}
\end{tikzpicture}
\end{document}