0

I want to draw hypergraph in LaTex, I've studied the code from previous question on this site and try modify the code to find picture below but I have not been able to draw a hypergraph as I want it.

  • It would be great if you could show us what you have tried. Posting a minimal working example that indicates what you are trying to do makes it easier for people to understand what you want. It also makes it easier for people to help you, since they have some code to start from, and hence much more likely that some one will try to help you. –  Nov 09 '17 at 14:43
  • 1
    Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE). This isn't a "Please do my work for me" site! What do you have so far? Try to create ... You could draw rotated ellipse. You can start with something like this: Confused about TikZ \draw[rotate=angle] – Bobyandbob Nov 09 '17 at 14:44

1 Answers1

3
\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{shapes.geometric}

\begin{document}
\begin{tikzpicture}[
    dot/.style={draw, circle, inner sep=1pt, fill=black},
    group/.style={draw=#1, ellipse, ultra thick, minimum width=4cm, minimum height=1.25cm}
    ]

    \node[dot,label=below left:$x_3$] at (0,0) (x3) {};
    \node[dot,label=below:$x_4$] at (1,0) (x4) {};
    \node[dot,label=below right:$x_5$] at (2,0) (x5) {};
    \node[dot,label=left:$x_2$] at (0.5,1) (x2) {};
    \node[dot,label=right:$x_6$] at (1.5,1) (x6) {};
    \node[dot,label=$x_1$] at (1,2) (x1) {};

    \node[group=cyan, label={[cyan]below:$E_2$}] at (x4) (E2) {};
    \node[group=olive, label={[olive]above right:$E_3$}, rotate=63] at (x2) (E3) {};
    \node[group=red, label={[red]above left:$E_1$}, rotate=-63] at (x6) (E1) {};
\end{tikzpicture}
\end{document}

enter image description here

Ignasi
  • 136,588