1

Can anyone please tell me how I would make the following image using TikZ?

enter image description here

I'm new to using TikZ and have so far made a couple graph theory type graphs, but i'm unsure how to make embedded images like this.

0

2 Answers 2

7
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\begin{document}
  \begin{tikzpicture}[font=\tiny,framed,background rectangle/.style={thick,draw=orange,fill=orange!10}]
    \path[use as bounding box] (-1,-1) rectangle (4,4);
    \draw[rotate around={-45:(2,2)}] (2,2) circle(2cm and 1.5cm);
    \draw[red,rotate around={-50:(2.3,1.75)}] (2.3,1.75) circle(1.5cm and 1cm);
    \begin{scope}[rotate=45]
    \fill[blue!20] (0,0) circle (4pt);
    \foreach \x in {-3,...,40}{
      \draw[blue,shorten >= rand*15] (0,0) -- (rand*\x:3);
      }      
      \fill[blue] (0,0) circle(2pt);
    \end{scope}
    \node[anchor=north west] at ([yshift=-5mm]current bounding box.north west) {$2m$ graph};
    \node[anchor=north] at ([yshift=-5mm]current bounding box.north) {$m$ graph};
    \node[anchor=west] at ([shift={(0mm,12mm)}]current bounding box.center) {$n$ graph};
  \end{tikzpicture}
\end{document}

enter image description here

1
  • oh this is great! Thank you for spending your time on this. I'm going to poke at your code to better understand it.
    – Ozera
    Commented Nov 2, 2015 at 6:29
3

This should get you started. So long as a line terminates inside the ellipse it should give the proper 3D effect.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (start) at (-1,-1);
\fill[blue] (start) circle[radius=0.05];
\draw[blue] (start) -- (1,1);
\draw[red] (1,1) ellipse[x radius=1,y radius=2,rotate=45];
\node at (-1,2.5) {\tiny centered};
\end{tikzpicture}
\end{document}

enter image description here

1
  • Thank you for this information! It is giving me some great information on TikZ
    – Ozera
    Commented Nov 2, 2015 at 6:29

You must log in to answer this question.

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