
我真的很想要一個像這樣的角色:
但我得到的只是這個:
為什麼我的不透明度不起作用?有了一個帶有所有座標的 TEX 文件,你知道有什麼東西可以很好地繪製這些 2D 函數隨時間的變化嗎?
這是我的 TEX 程式碼。
\begin{document}
\begin{tikzpicture}
\pgfplotstableread{
plot1 plot2 plot3 plot4 plot5
0 0 0 0 0
0.348081 0.187042 0.0673327 0.0784015 0.0455678
0.165143 0 0.0664995 0.0685961 0.0375407
0.17641 0.0781801 0 0 0
0.183147 0.421627 0.471163 0.367463 0.268439
0.106028 0.145975 0.185666 0.240872 0.357571
0.0164603 0.107278 0.114965 0.130172 0.170262
0.00473057 0.0598978 0.0943741 0.114495 0.120619
0 0 0 0 0
}\dummydata
\begin{axis}[
samples=30,
domain=0:1,
samples y=0, ytick={1,...,5},
zmin=0,
area plot/.style={
fill opacity=0.2,
draw=none,
fill=blue!70,
mark=none,
smooth
}
]
\pgfplotsinvokeforeach{5,4,3,...,1}{
\addplot3 [area plot] table [x expr=\coordindex, y expr=#1,
z=plot#1]
{\dummydata};
}
\end{axis}
\end{tikzpicture}
\end{document}
答案1
我正在使用 TeXLive 2016,我想我的程式碼完全達到了您想要的不透明度:
\documentclass{memoir}
\usepackage{tikz,pgfplotstable}
\begin{document}
\begin{tikzpicture}
\pgfplotstableread{
plot1 plot2 plot3 plot4 plot5
0 0 0 0 0
0.348081 0.187042 0.0673327 0.0784015 0.0455678
0.165143 0 0.0664995 0.0685961 0.0375407
0.17641 0.0781801 0 0 0
0.183147 0.421627 0.471163 0.367463 0.268439
0.106028 0.145975 0.185666 0.240872 0.357571
0.0164603 0.107278 0.114965 0.130172 0.170262
0.00473057 0.0598978 0.0943741 0.114495 0.120619
0 0 0 0 0
}\dummydata
\begin{axis}[
samples=30,
domain=0:1,
samples y=0,
ytick={1,...,5},
zmin=0,
area plot/.style={
fill opacity=0.2,
draw=none,
% densely dashed, very thin,% I would consider this line or a similar line instad of draw=none
fill=blue!70,
mark=none,
smooth
}
]
\pgfplotsinvokeforeach{5,4,3,...,1}{
\addplot3 [area plot] table [x expr=\coordindex, y expr=#1, z=plot#1]{\dummydata};
}
\end{axis}
\end{tikzpicture}
\end{document}
這適用於 pdfLaTeX 和 LuaLaTeX。請考慮添加完整的 MWE\documentclass
以及所有包包必要的,參見怎樣才是一個好的 MWE?。
作為阿爾卑斯水注意到,透明度對於某些觀眾來說可能是個問題,請參閱https://en.wikipedia.org/wiki/Portable_Document_Format#Transparency。
貼文在 3d 圖中繪製多個 2d 函數似乎相關。