2

enter image description hereI would like to draw nodes inside those two ellipses(and then draw edges).I would also like some of the vertices to be within another elipse The code is

\begin {center}
\begin {tikzpicture}
\tikz 
\draw (5,0) ellipse (4cm and 0.5cm);
\end{tikzpicture}
\end {center}
\begin {center}
\begin{tikzpicture}
\tikz \draw (5,0) ellipse (4cm and 0.5cm);
\end{tikzpicture}
\end {center}
  • You don't need \tikz, you already have the tikzpicture environment. Please post compilable code and clarify what you want to achieve. You can use some mock-up picture for this. – Alenanno Mar 18 '16 at 17:31
  • I will trie without \tikz, seems that i can draw vertices in this way inside the elipse.I will also try to ordinate another elipse inside – Jac Mar 18 '16 at 17:50
1
\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{3d}

\begin{document}

   \begin{tikzpicture}
     [x={(-0.2cm,-0.4cm)}, y={(1cm,0cm)}, z={(0cm,1cm)}, scale=2,fill
     opacity=0.80,color={gray}]

 \tikzset{zxplane/.style={canvas is zx plane at y=#1,very thin}}
 \tikzset{yxplane/.style={canvas is yx plane at z=#1,very thin}}


\begin{scope}[yxplane=-1]
   \path[shade,draw] (0,0) circle[x radius = 2 cm,y radius =1 cm] ;
   \path[shade,draw] (1,0) circle[x radius = 0.6 cm,y radius =0.3cm] ;
   \path[shade,draw] (-1,0) circle[x radius = 0.6 cm,y radius =0.3cm] ;
    \path coordinate (a1) at (-1,0)
          coordinate (a2) at (-1.2,0)
          coordinate (b1) at (1.2,0);
\end{scope}


\begin{scope}[yxplane=1]
   \path[shade,draw] (0,0) circle[x radius = 2 cm,y radius =1 cm] ;
   \path[shade,draw] (1,0) circle[x radius = 0.6 cm,y radius =0.3cm] ;
   \path coordinate (a) at (-1,0)
         coordinate (b) at (1,0);
\end{scope}
    \draw (a)--(a1) (a)--(a2) (b)--(b1);
    \foreach \point in {a,a1,a2,b,b1}
      \fill [black,opacity=.5] (\point) circle (1pt);
 \end{tikzpicture} 
\end{document}

enter image description here

  • Need some dashed lines with some good clips ... – Alain Matthes Mar 18 '16 at 18:29
  • Why the shading? :P – Alenanno Mar 18 '16 at 19:14
  • @Alenanno Only for the fun ! and because I used the 3d library but it's easy to remove – Alain Matthes Mar 18 '16 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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