2

I need to draw a picture, the picture is showed below. Which package is better to draw it,TikZ?

Circle representing set A, which is independent of partially overlapping circles B and C; all three sets are in a rectangle U

  • 4
    We don't usually like “Draw this for me questions”. This one is easily done after reading one or two of the first pages of the manual. – Manuel Feb 1 '15 at 16:07
  • You can find excellent tutorials in the manual. At least help us out with a basic document that loads the proper packages. I think you'll find this picture is very simple, if you just give it a try. – darthbith Feb 1 '15 at 16:08
  • 4
    TikZ is a bit frightening at first sight (just the page counter in the pdf freaks me out on its own!), but don't be put off. Have a try, and if you get into difficulties, bring them back here and there are lots of clever people who should be able to help. – Brent.Longborough Feb 1 '15 at 18:04
  • Take a look at these examples of Venn diagrams in TiKZ: tex.stackexchange.com/questions/26096/… – Benjamin McKay Feb 1 '15 at 18:14
4

A PSTricks solution:

\documentclass{article}

\usepackage{pstricks}

\begin{document}

\begin{pspicture}(8,4)
  \large
  \psframe(0,0)(8,4)
  \rput(0.5,0.5){$\mathbf{U}$}
  \pscircle(1.8,2.8){0.7}
  \rput(2.6,3.6){$\mathbf{A}$}
  \pscircle(6.2,2.5){1.3}
  \rput(7.5,3.6){$\mathbf{B}$}
  \pscircle(5.3,1.5){1.3}
  \rput(6.5,0.4){$\mathbf{C}$}
\end{pspicture}

\end{document}

output

| improve this answer | |
3

Another TikZ option, but without the fit library and with an auxiliary style:

\documentclass[tikz,border=4]{standalone}

\begin{document}

\begin{tikzpicture}[
mcircle/.style={circle,draw,inner sep=#1}
]
\node[mcircle=0.7cm,label={60:$\mathbf{A}$}] 
  (a) at (1,1.5) {};5
\node[mcircle=1.3cm,label={60:$\mathbf{B}$}] 
  (b) at (8.5,1.5) {};
\node[mcircle=1.3cm,label={-60:$\mathbf{C}$}] 
  (c) at (7,0) {};
\draw
  ([shift={(-8pt,8pt)}]a.west|-b.north) rectangle ([shift={(8pt,-8pt)}]b.east|-c.south);
\node at (a.west|-c.south) {$\mathbf{U}$};
\end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |
3

Can't let a pstricks answer alone, it needs company BTW ;-)

\documentclass[tikz,border=4]{standalone}
\usetikzlibrary{fit}
\begin{document}
  \begin{tikzpicture}
    \node[circle,draw,inner sep=0.7cm,label={[font=\bfseries]60:A}] (a) at (1,1.5) {};5
    \node[circle,draw,inner sep=1.3cm,label={[font=\bfseries]60:B}] (b) at (8.5,1.5) {};
    \node[circle,draw,inner sep=1.3cm,label={[font=\bfseries]-60:C}] (c) at (7,0) {};
    \node[draw,fit=(a)(b)(c),inner sep=7pt,
                label={[font=\bfseries,shift={(4ex,4ex)}]south west:U}] {};
  \end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
2

Another option.

\documentclass{scrartcl}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[font=\bfseries]
  \draw (4,2) rectangle (-4,-2) node[above right] {U};
  \draw ( -2,0.8) circle[radius=0.7] +( 50:0.7) node[right] {A};
  \draw (2.5,0.7) circle[radius=1.2] +( 45:1.2) node[right] {B};
  \draw (1.5,-.7) circle[radius=1.2] +(-40:1.2) node[right] {C};
\end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |

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.