![pgfplots:如何缩放轴以使立方体粘在一起](https://linux22.com/image/419769/pgfplots%EF%BC%9A%E5%A6%82%E4%BD%95%E7%BC%A9%E6%94%BE%E8%BD%B4%E4%BB%A5%E4%BD%BF%E7%AB%8B%E6%96%B9%E4%BD%93%E7%B2%98%E5%9C%A8%E4%B8%80%E8%B5%B7.png)
我有一个3D-情节产生
正确的缩放方法是什么x 轴和 y 轴这样立方体0,1,2,3粘在一起?像这样:
\documentclass[border=10pt, varwidth]{standalone}
\usepackage{pgfplotstable}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\pgfplotstableread[col sep=comma,header=true]{
X, Y, Z
0, 0, 0
1, 0, 0
2, 0, 0
1, -1, 0
4, 0, 0
}{\datatable}
\begin{tikzpicture}
\begin{axis}[
%xmin=0, xmax=6,
ymin=-1, ymax=1,
zmin=0, zmax=1,
grid=both,
point meta=explicit, % colors 1/2
xlabel={$x$}, ylabel={$y$}, zlabel={$z$},
% x=3mm, y=1cm, z=1cm, % not a good idea
]
\addplot3[scatter, mark=*, only marks,
mark=cube*, mark size=7,
nodes near coords*=\coordindex,
] table [x=X, y=Y,z=Z,
meta expr={\thisrow{X}} % colors 2/2
] {\datatable};
\end{axis}
\end{tikzpicture}
\end{document}