椭圆内的节点

椭圆内的节点

在此处输入图片描述我想在这两个椭圆内绘制节点(然后绘制边)。我还希望一些顶点位于另一个椭圆内。代码是

\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}

答案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}

在此处输入图片描述

相关内容