我想画一个三维条形图。我用这个 MWE 代码画了二维图。能像最后一张照片那样画成 3D 吗?
最大误差:(来源)
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\pgfplotstableread[row sep=\\,col sep=&]{
interval & carT & carD & carR \\
Type A & 10 & 15 & 20 \\
Type B & 8 & 6 & 12 \\
Type C & 5 & 8 & 10 \\
}\mydata
\begin{tikzpicture}
\begin{axis}[
ybar,
bar width=.5cm,
width=\textwidth,
height=.5\textwidth,
legend style={at={(0.5,1)},
anchor=north,legend columns=-1},
symbolic x coords={Type A, Type B, Type C},
xtick=data,
nodes near coords,
nodes near coords align={vertical},
ymin=0,ymax=35,
]
\addplot table[x=interval,y=carT]{\mydata};
\addplot table[x=interval,y=carD]{\mydata};
\addplot table[x=interval,y=carR]{\mydata};
\legend{AA, BB, CC}
\end{axis}
\end{tikzpicture}
\end{document}
结果是:
我想要这个输出: