Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I woud like create 3 sector circle node. See the following figure

enter image description here

sectors are bounded by lines

share|improve this question

4 Answers 4

up vote 8 down vote accepted

Update 2

I think better than my first version is to use a style. I added with the last update the possibility to modify the style for the intern nodes.

\documentclass[11pt]{scrartcl}
\usepackage{tikz}
%\usetikzlibrary{shapes} now not necessary
\begin{document}

\tikzset{sectors/.style n args={5}{%
  circle,
  draw,
  minimum width=#4,
  append after command={%
  \pgfextra{ %
   \draw (\tikzlastnode.center) -- (\tikzlastnode.south) ;
   \draw (\tikzlastnode.west)   -- (\tikzlastnode.east) ;
   \path (\tikzlastnode.center) -- node[#5] {#1} (\tikzlastnode.north);  
   \path (\tikzlastnode.center) -- node[#5] {#2} (\tikzlastnode.south west); 
   \path (\tikzlastnode.center) -- node[#5] {#3} (\tikzlastnode.south east); } }}}

\begin{tikzpicture}[ultra thick]
  \node [sectors={1}{2}{3}{4cm}{font=\Huge\bfseries,text=red}]  (c)  {};
\end{tikzpicture}

\end{document} 

enter image description here

Another idea

\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}

\begin{tikzpicture}[ultra thick]
  \node [circle split,
         draw,
         minimum width=4cm,
         append after command={%
         \pgfextra{\draw (\tikzlastnode.center) -- (\tikzlastnode.south) ;
                  } 
                  }]  (c)  {};
  \node[yshift=2em] at (c.center) {\huge \textbf{1}};  
  \node[xshift=-2em,yshift=-2em] at (c.center) {\huge \textbf{2}}; 
  \node[xshift= 2em,yshift=-2em] at (c.center) {\huge \textbf{3}};  
\end{tikzpicture}

\end{document} 

enter image description here

share|improve this answer
    
It's possible to avoid circle split and to use only circle. In this case, you need to draw the horizontal line. It's possible also to place 1,2 and 3 with the anchors. –  Alain Matthes Jun 8 '12 at 7:10

You can do something like this:

\documentclass{article}
\usepackage{tikz}

\newlength\radius
\setlength\radius{7mm}

\begin{document}

\begin{tikzpicture}
\draw circle (\radius);
\draw +(-\radius,0) -- +(\radius,0);
\draw +(0,-\radius) -- +(0,0);
\node[font=\Large\sffamily] at (0,0.5\radius) {1};
\node[font=\Large\sffamily] at (-0.35\radius,-0.5\radius) {2};
\node[font=\Large\sffamily] at (0.35\radius,-0.5\radius) {3};
\end{tikzpicture}

\end{document}

enter image description here

Now that I re-read the question, I see that you wanted tp use a \node for the circle, so here's some possible solution using \node:

\documentclass{article}
\usepackage{tikz}

\newlength\diam
\setlength\diam{14mm}

\begin{document}

\begin{tikzpicture}
\node[draw,circle,inner sep=0pt,minimum width=\diam] (circ) {};
\draw (circ.180) -- (circ.0);
\draw (circ.270) -- +(0,0.5\diam);
\node[font=\Large\sffamily,yshift=0.25\diam] at (circ.center) {1};
\node[font=\Large\sffamily,xshift=-0.18\diam,yshift=-0.25\diam] {2};
\node[font=\Large\sffamily,xshift=0.18\diam,yshift=-0.25\diam] {3};
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer

Here, two solutions: first is directly derived from Gonzalo Medina's solution. Second uses a more "robust" technique (via fit library): materials may not exceed the circle.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,fit}

\begin{document}
\begin{tikzpicture}
  \node[draw,circle,inner sep=0pt,minimum width=3.5em] (circ) {};
  \draw (circ.180) -- (circ.0);
  \draw (circ.270) -- (circ.center);
  \path (circ.center) -- node{1}(circ.90);
  \path (circ.center) -- node{2}(circ.-135);
  \path (circ.center) -- node{3}(circ.-45);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (center) at (0,0);
  \node[above=0mm of center](p1){1};
  \node[below left=0mm of center](p2){2};
  \node[below right=0mm of center](p3){3};
  \node[draw,inner sep=0pt,circle,fit=(p1)(p2)(p3)](c){};
  \draw (center) -- (c.0);
  \draw (center) -- (c.180);
  \draw (center) -- (c.-90);
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

[fr] il me semble qu'aucune des solutions proposées n'est robuste

il est nécessaire de modifier légérement la 2eme solution de PolGab pour obtenir une solution qui s'adapte au nombre de caractères en précisant le centre du noeud

[en] it seems to me that none of the solutions proposed is robust

it is necessary to modify slightly the 2nd PolGab solution to obtain a solution that adapts to the number of characters specifying the center of the node

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,fit}

\begin{document}

\begin{tikzpicture}
  \coordinate (center) at (0,0);
  \node[above=0mm of center](p1){1};
  \node[below left=0mm of center](p2){2};
  \node[below right=0mm of center](p3){3};
  \node[draw,inner sep=0pt,circle,fit=(p1)(p2)(p3)](c)at (center){};
  \draw (center) -- (c.0);
  \draw (center) -- (c.180);
  \draw (center) -- (c.-90);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (center) at (0,0);
  \node[above=0mm of center](p1){1};
  \node[below left=0mm of center](p2){2};
  \node[below right=0mm of center](p3){312};
  \node[draw,inner sep=0pt,circle,fit=(p1)(p2)(p3)](c)at (center){};
  \draw (center) -- (c.0);
  \draw (center) -- (c.180);
  \draw (center) -- (c.-90);
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
My way resists with : \node [sectors={1}{2}{352}{4cm}{font=\Huge\bfseries,text=red,xshift=1ex}] (c) {}; –  Alain Matthes Jun 8 '12 at 12:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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