# Indicating axis rotation with pgfplots

I use pgfplots to render the mesh of a truncated cone in a 3D coordinate system like this:

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view={15}{30},
axis lines=center,
ticks = none,
scaled ticks=false,
enlarge x limits=0.25,
enlarge y limits=0.85,
enlarge z limits=0.55,
axis on top=true,
x axis line style={opacity=0.5},
y axis line style={opacity=0.5},
z axis line style={opacity=0.5},
y label style={at={(axis description cs:0.4, 0.73)},anchor=north},
xlabel={$x$}, ylabel={$-z$}, zlabel={$y$}
]
\addplot3[patch, opacity=0.7, patch table={indices.txt}] file {points.txt};
\end{axis}
\end{tikzpicture}
\end{document}


The current result:

I would also like to include an indication of the axis rotation similar to this thread: Circular arrow in 3D to indicate a unit axis rotation

Is that possible with pgfplots?

Here is a MWE you could work with :

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\usepackage{tikz-3dplot}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
view={15}{30},
axis lines=center,
ticks = none,
scaled ticks=false,
axis equal,
enlarge x limits=0.25,
enlarge y limits=0.85,
enlarge z limits=0.55,
axis on top=true,
x axis line style={opacity=0.5},
y axis line style={opacity=0.5},
z axis line style={opacity=0.5},
y label style={at={(axis description cs:0.4, 0.73)},anchor=north},
xlabel={$x$}, ylabel={$-z$}, zlabel={$y$}]
\addplot3[patch, opacity=0.7, patch table={indices.txt}] file {points.txt};
\begin{scope}[canvas is yz plane at x=100]
\draw [->] (30,0,0) arc (0:-350:30);
\end{scope}
\begin{scope}[canvas is xy plane at z=100]
\draw [->] (30,0,0) arc (0:-350:30);
\end{scope}
\begin{scope}[canvas is xz plane at y=100]
\draw [->] (30,0,0) arc (0:-350:30);
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}


• Looks great, thank you very much! I will see how I can make use of this!
– ekk
Sep 25, 2016 at 16:47
• Thank you for the good description. Would it be possible to get your data set once? I would like to create this plot from MATLAB data but I do not know exactly what data I need for this. Thank you very much! Best regards
– J L
Dec 20, 2020 at 13:32
• @JL There was no data set here, there is no points on the graph of my answer. I left indices.txt and points.txt here for the example ;) Dec 20, 2020 at 18:33