
我有一組正在 3D 中繪製的形狀\addplot3
(例如圓錐體),並且需要讓它們指向巨集參數指定的方向。我願意不是只想更改視角或旋轉整個繪圖/軸,因為我將繪製我想正常繪製的其他內容。有沒有一種簡單的方法可以透過一些參數\addplot3
或其他方式來做到這一點(旋轉我的圓錐體和其他形狀) ?或者我必須在方程中手動執行此操作? (我懷疑有什麼,但我想在通過方程式做之前我應該嘗試一下。=P)
對於我的 MWE,這是我想要旋轉的圓錐體:
\documentclass[12pt]{article}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{3d}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}[scale=2]
\begin{axis}[axis lines=center, axis on top, samples=30,
xmin=-1.5, xmax=1.5, ymin=-1.5, ymax=1.5, zmin=0.0]
\addplot3 [surf, shader=interp, domain=0:1, y domain=0:2*pi] ({x*cos(deg(y))},{x*sin(deg(y))},{x});
\end{axis}
\end{tikzpicture}
\end{document}