Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want the arrowhead to look more natural as opposed to goofy (which is the present state)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.new, decorations.markings, calc, fadings,
decorations.pathreplacing, patterns, decorations.pathmorphing, positioning}
\newcommand{\AxisRotator}[1][rotate=0] {%
  \tikz \draw[x = .5em, y = 1.25em, line width = .2ex, -latex, #1] (0,0)  arc (-150:150:.5 and .5);%                                                   
  }

\begin{document}
\begin{center}
  \begin{tikzpicture}[scale = .75]
    \draw (-2,0) -- (-3,1.5);
    \draw (2,0) -- (3,1.5);
    \draw (-2,0) -- (2,0);
    \draw[-latex] (0,.75) -- (0,2);
    \draw (0,1.5) node {\AxisRotator[rotate = -90]};
    \begin{scope}[yshift = .25cm]
      \clip (-2.5,1) -- (2.5,1) -- (2.5,.25) -- (-2.5,.25) -- cycle;
      \draw (0,1) ellipse (2.75cm and .5cm);
    \end{scope}
  \end{tikzpicture}
\end{center}
\end{document}
share|improve this question

2 Answers 2

up vote 8 down vote accepted

Perhaps using a decoration:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.new, decorations.markings, calc, fadings,
decorations.pathreplacing, patterns, decorations.pathmorphing, positioning}
\newcommand{\AxisRotator}[1][rotate=0]{%
  \tikz[decoration={
    markings,
    mark=at position 1 with {\arrow{latex}}}]\draw[x = .5em, y = 2.75em, line width = .2ex,#1,postaction=decorate] (0,0)  arc (-150:150:.45 and .5) -- ++(-95:2pt);%                                                   
}

\begin{document}
\begin{center}
  \begin{tikzpicture}[scale = .75]
    \draw (-2,0) -- (-3,1.5);
    \draw (2,0) -- (3,1.5);
    \draw (-2,0) -- (2,0);
    \draw[-latex] (0,.75) -- (0,2);
    \draw (0,1.5) node {\AxisRotator[rotate = -90]};
    \begin{scope}[yshift = .25cm]
      \clip (-2.5,1) -- (2.5,1) -- (2.5,.25) -- (-2.5,.25) -- cycle;
      \draw (0,1) ellipse (2.75cm and .5cm);
    \end{scope}
  \end{tikzpicture}
\end{center}

\end{document}

enter image description here

For comparison purposes, here's the result with the original code in the question:

enter image description here

And here's the result for various angles:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.new, decorations.markings, calc, fadings,
decorations.pathreplacing, patterns, decorations.pathmorphing, positioning}

\newcommand{\AxisRotator}[1][rotate=0] {%
  \tikz[decoration={
    markings,
    mark=at position 1 with {\arrow{latex}}}]\draw[x = .5em, y = 2.75em, line width = .2ex,#1,postaction=decorate] (0,0)  arc (-150:150:.45 and .5) -- ++(-95:2pt);%                                                   
  }

\begin{document}

\begin{tikzpicture}[scale = .75]
\foreach \angle[count=\xi] in {0,45,...,315}
  \draw (0,1.5) node at (0,1.5*\xi) {\AxisRotator[rotate = \angle]};
\end{tikzpicture}

\end{document}

enter image description here

I used -- ++(-95:2pt) at the end of the arc path just to extend it a little allowing the arrow to be well positioned.

share|improve this answer
    
I don't think that is much better. –  dustin Apr 19 '13 at 23:41
1  
@dustin please see my updated answer. Perhaps it is a little better now? –  Gonzalo Medina Apr 19 '13 at 23:45
    
can you explain ++(-100:1pt)? –  dustin Apr 19 '13 at 23:55
1  
@dustin sure! It's just a trick: I added a little line segment at the end of the arc path to move the arrow tip a little. –  Gonzalo Medina Apr 19 '13 at 23:58
    
FWIW metapost arrows follow the curve a little better (mp actually curves the arrowheads). For arrowheads where the curve is too tight they look goofy in a completely different way! So if you're interested in a metapost (or asymptote, or pstricks) solution, then indicate that, and several advocates of their favourite graphics language will leap to your aid. –  Andrew Kepert Apr 21 '13 at 5:57

arrows.meta library (TikZ 3.0, section 16) introduces more flexibility for drawing arrows. This version also presents pics which help to avoid drawing tikzpictures inside tikzpictures. Next code combines both tools.

The AxisRotator pic is placed according ellipse's center (which has been defined by trial and error).

\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, positioning}

\tikzset{
    pics/AxisRotator/.style={
    code={
        \draw [x=1em, y=1em, line width=.2ex, -{Latex[length=.5em, quick]},rotate=#1] (-.25,-.7) arc (-150:165:.3375 and 1.375);
    }},
    pics/AxisRotator/.default=0
}

\begin{document}
  \begin{tikzpicture}[scale = .75]
    \draw (-2,0) -- (-3,1.5);
    \draw (2,0) -- (3,1.5);
    \draw (-2,0) -- (2,0);
    \draw[-latex] (0,.75) -- (0,2);
    \draw (0,1.5) pic {AxisRotator=-90};
    \begin{scope}[yshift = .25cm]
      \clip (-2.5,1) -- (2.5,1) -- (2.5,.25) -- (-2.5,.25) -- cycle;
      \draw (0,1) ellipse (2.75cm and .5cm);
    \end{scope}
  \end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.