5

In relation to this quesion:

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

2
  • 2
    Welcome to TeX.SX. What do you mean by rotated ellipse? Kindly add the code you have tried so far.
    – user11232
    Commented Aug 7, 2013 at 8: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. Commented Aug 7, 2013 at 9:09

2 Answers 2

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

4
  • Thanks a lot; This will do the trick. How can i prevent the drawing of the ellipse? I don't want it to be visible; I just need the nodes to be at the corresponding coordinates. Commented Aug 7, 2013 at 13:20
  • 1
    @GarlefWegart Please see the edit.
    – user11232
    Commented Aug 7, 2013 at 13:57
  • Great answer; Thank you. Misfortunately I can't give you more then one +1 :) Commented Aug 7, 2013 at 14:00
  • @GarlefWegart: Glad it helped :)
    – user11232
    Commented Aug 7, 2013 at 14:02
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}  
1

You must log in to answer this question.

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