我基本上想使用此命令\node at (0.1,0.1) { \colorbox{white}{\textcolor{black}{$A$}}};
并为 3D 添加一个维度。不幸的是,这不起作用,互联网只向我解释了如何制作矢量和线条,但没有解释简单的节点。这里最简单的方法是什么?
感谢您的帮助。
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[grid=major,view={210}{30},
ymin=0,
ymax=10,
xmin=0,
xmax=10,
zmin=0,
zmax=1200,
xtick={0,10},
xticklabels={{10},{0}},
ytick={0,10},
ztick={0,1200},
,colormap/blackwhite, rotate around z=20
]
\addplot3+[mesh,scatter,samples=10,domain=0:10]
{y^3};
\addplot3 [data cs=cart,surf,domain=0:10,samples=2, opacity=0.5]
{x^3};
\end{axis}
\end{tikzpicture}
\end{document}
答案1
使用较新版本的 pgfplots 后,您不再需要axis cs:
。我对 TeXMaker 一无所知。
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[grid=major,view={210}{30},
ymin=0,
ymax=10,
xmin=0,
xmax=10,
zmin=0,
zmax=1200,
xtick={0,10},
xticklabels={{10},{0}},
ytick={0,10},
ztick={0,1200},
,colormap/blackwhite, rotate around z=20
]
\addplot3+[mesh,scatter,samples=10,domain=0:10]
{y^3};
\addplot3 [data cs=cart,surf,domain=0:10,samples=2, opacity=0.5]
{x^3};
\node[fill=white,anchor=north east] at (0.1,0.1,1000) {$A$};
\end{axis}
\end{tikzpicture}
\end{document}