5

In relation to this quesion:

How can one place nodes along a rotated ellipse? ()

  • 2
    Welcome to TeX.SX. What do you mean by rotated ellipse? Kindly add the code you have tried so far. –  Aug 07 '13 at 08:28
  • An ellipse where the major axis is not in parallel to the x- or the y-axis. For code and graphical illustration in the unrotated case please take a loot at the linked question. – Gerrit Begher Aug 07 '13 at 09:09

2 Answers2

10

It is not clear to me how your code will look like that draws a rotated ellipse. The code in the linked answer can be simply rotated as a whole by \begin{tikzpicture}[rotate=60]:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}[rotate=60]
    \draw (2,0) ellipse (2 and 1);
    \node[draw,fill=blue,circle,text=white] at ($(2,0)+(75:2 and 1)$) {A};
    \node[draw,fill=red,circle,text=white] at ($(2,0)+(275:2 and 1)$) {B};
\end{tikzpicture}
\end{document} 

enter image description here

If you want the node contents to be rotated too, then use transform shape like \begin{tikzpicture}[rotate=60,transform shape] in the above code.

enter image description here

To address the query in the comments:

To hide the ellipse itself you may

  1. comment out the entire line

    \draw (2,0) ellipse (2 and 1);
    
  2. use draw=none as the option

    \path[draw=none] (2,0) ellipse (2 and 1);
    

Some sample code for fun:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
%
\begin{document}
\begin{tikzpicture}[rotate=60]
\foreach \x/\y in {0/A,30/B,60/C,90/D,120/E,150/F,180/G,210/H,240/I,270/J,300/K,330/L}{
    \node[draw=none,minimum width=10pt,fill=blue!60!green!30,circle,text=white,inner sep=0pt,outer sep=0pt] at ($(2,0)+(\x:2 and 1)$) {\y};
    }
\end{tikzpicture}
\end{document}

enter image description here

3

You can also use an arc to draw the ellipse, which allows you to place the nodes a specified distance along the border of the ellipse:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw [rotate=30, x radius=2cm, y radius=1cm, delta angle=360] (0,0)
    arc [start angle=0]
    node [pos=0.13] {A}
    node [pos=0.75] {B};
\end{tikzpicture}
\end{document}  
Jake
  • 232,450