答案1
代码来自Tom 对你上一个问题的回答,这可能是一个起点:
\documentclass[tikz, border=2mm]{standalone}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.12}
\usepackage{filecontents}
\begin{filecontents*}{s.dat}
x y m
1 2 3
2 1 4
1 1 2
2 2 1
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[ view={120}{40},
xmin=0,xmax=3,
ymin=0,ymax=3,
zmin=0, zmax=5,
]
\addplot3[only marks, ycomb, scatter, mark=cube*, mark size=3,
point meta=explicit, z filter/.code={\pgfmathparse{0}\pgfmathresult},
] table[meta=m] {s.dat};
\addplot3[mark=none, ycomb] table {s.dat};
\end{axis}
\begin{axis}[
hide axis,
domain=0:1,
y domain=0:-2*pi,
xmin=-1.5, xmax=1.5,
ymin=-1.5, ymax=1.5, zmin=-1.2,
samples=10,
samples y=40,
z buffer=sort,
]
\addplot3[mesh]
({1.1*x*cos(deg(y))},{1.1*x*sin(deg(y))},{-x});
\end{axis}
\end{tikzpicture}
\end{document}
仅使用散点图:
\documentclass[tikz, border=2mm]{standalone}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.12}
\usepackage{filecontents}
\begin{filecontents*}{s.dat}
x y m
1 2 3
2 1 4
1 1 2
2 2 1
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[ view={120}{40},
xmin=0,xmax=3,
ymin=0,ymax=3,
zmin=0, zmax=5,
]
\addplot3[only marks, scatter, mark=*, mark size=3,
point meta=explicit, z filter/.code={\pgfmathparse{0}\pgfmathresult},
] table[meta=m] {s.dat};
\end{axis}
\begin{axis}[
hide axis,
domain=0:1,
y domain=0:-2*pi,
xmin=-1.5, xmax=1.5,
ymin=-1.5, ymax=1.5, zmin=-1.2,
samples=10,
samples y=40,
z buffer=sort,
]
\addplot3[mesh,olive]
({1.1*x*cos(deg(y))},{1.1*x*sin(deg(y))},{-x});
\end{axis}
\end{tikzpicture}
\end{document}