2

I want to create a figure as shown with latex/tikz. It contains a three-axis space, 3D arrow with text inside and shadows, and 3D-rotated axis titles etc. Only other examples I find are about 3D arrowheads without shadow. Can someone help me achieve this please? I am open to alternatives to tikz as well, as long as it is created in Latex.enter image description here

4
  • Could you please show us which 3D arrow you are referring to?
    – user121799
    Oct 15, 2018 at 12:28
  • The blue one in the picture with "Name" on it.
    – Ankush
    Oct 15, 2018 at 14:46
  • I am referring to your statement "Only other examples I find are about 3D arrowheads without shadow." This seems to suggest that already have found some suitable 3D arrow, and I would like to ask you to add it with the code to your question.
    – user121799
    Oct 15, 2018 at 14:51
  • Oh sorry. I am referring to this tex.stackexchange.com/questions/51340/… However, as you see those arrows are rather different from what I need.
    – Ankush
    Oct 15, 2018 at 14:55

1 Answer 1

2

Here is a proposal.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d,shapes.geometric,shadows.blur}
% small fix for canvas is xy plane at z % https://tex.stackexchange.com/a/48776/121799
\makeatletter
\tikzoption{canvas is xy plane at z}[]{%
    \def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
    \def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}%
    \def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}%
    \tikz@canvas@is@plane}
\makeatother

\begin{document}
\tdplotsetmaincoords{60}{70}
\begin{tikzpicture}[tdplot_main_coords,>=latex,line join=bevel]
    \coordinate (O) at (0,0,0);
    \begin{scope}[canvas is xy plane at z=0,transform shape]
     \node[ellipse,fill=orange,fill opacity=0.3,text=red,font=\sffamily,
     minimum width=2cm,minimum height=0.5cm,rotate=90] at (0.75,2) {text A};
     \node[font=\sffamily] at (4,-0.5) {y axis};
     \node[ellipse,fill=orange,fill opacity=0.3,text=red,font=\sffamily,
     minimum width=2cm,minimum height=0.5cm] at (2,0.75) {text B};
     \node[font=\sffamily,rotate=90] at (-0.5,4) {x axis};   
     \begin{scope}[rotate=45]
      \path[blur shadow={shadow blur steps=5},yscale=0.5] (0,0) --  (4,0.2) coordinate (g1)
        -- (4,0.4) coordinate (g2) -- (4.4,0) coordinate (g3)
        -- (4,-0.4) coordinate (g4) -- (4,-0.2) coordinate (g5) -- cycle;
     \end{scope}  
    \end{scope}
    \begin{scope}[canvas is yz plane at x=0,transform shape]
    \node[ellipse,fill=orange,fill opacity=0.3,text=red,font=\sffamily,
    minimum width=2cm,minimum height=0.5cm,rotate=90] at (0.75,2) {text C};
    \node[font=\sffamily,rotate=90] at (-0.5,4) {z axis};
    \end{scope}
    \draw[thick,->] (0,0,0) -- (5,0,0);% node[anchor=north east]{$x$};
    \draw[thick,->] (0,0,0) -- (0,5,0);% node[anchor=north west]{$y$};
    \draw[thick,->] (0,0,0) -- (0,0,5);% node[anchor=south]{$z$};
    \tdplotsetrotatedcoords{60}{150}{45}
    \begin{scope}[tdplot_rotated_coords]
     \begin{scope}[canvas is yz plane at x=0,transform shape]
      \path  (4,0.2) coordinate (b1)
       -- (4,0.4) coordinate (b2) -- (4.4,0) coordinate (b3)
       -- (4,-0.4) coordinate (b4) -- (4,-0.2) coordinate (b5);
     \end{scope}
    \end{scope}
    \tdplotsetrotatedcoords{60}{152}{42}
    \begin{scope}[tdplot_rotated_coords]
     \begin{scope}[canvas is yz plane at x=0,transform shape]
      \draw[fill=blue!60] (0,0) --  (4,0.2) coordinate (f1)
       -- (4,0.4) coordinate (f2) -- (4.4,0) coordinate (f3)
       -- (4,-0.4) coordinate (f4) -- (4,-0.2) coordinate (f5) -- cycle;
       \path (2,0) -- (4,0) node[pos=1,font=\sffamily,anchor=east,yscale=-1]{some text};
     \end{scope}
    \end{scope}
    \draw[fill=blue!60!black] (f2) -- (f3) -- (b3) -- (b2) -- cycle; 
    \draw[fill=blue!60!black] (f4) -- (f3) -- (b3) -- (b4) -- cycle; 
\end{tikzpicture}
\end{document}

enter image description here

Note that I have a very weak internet connection at the moment, so I'd like to ask you to refrain from asking for many small corrections in many comments.

3
  • Can you add the text on the blue arrow ("name" in my example above)? When I add it within the third scope, it comes as strangely flipped.
    – Ankush
    Oct 16, 2018 at 17:36
  • @Ankush Done, ;-)
    – user121799
    Oct 16, 2018 at 18:06
  • 1
    For the record: Jake's patch is now incorporated in v3.1 of TikZ. Jan 15, 2019 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .