I do not know how to make a pie-chart as the one pictured below, which I drew by hand. I tried using "pgf-pie" for that, but it does not really work as I intend. Could you help me?

enter image description here





\pie [rotate = 90, text=inside, color = {yellow!50, green!50}, scale font]


  • Don't. Please don't Pie charts deliver almost zero information while wasting an inordinate amount of space on the page. There is never ever a case where a pie chart is the preferred style (excepting the collection of pie-chart jokes) . In your example, the meaning of the colors vs. the meaning of the dividing lines is completely unclear, and the labels make it even worse. Commented Jun 6, 2019 at 12:30

3 Answers 3


With plain TikZ you could do

\begin{tikzpicture}[declare function={R=2;}]
 \fill[blue!30] (0,R) arc(90:270:R);
 \fill[yellow] (0,R) arc(90:-90:R);
 \draw (0,0) circle[radius=R] (-R,0) node[left] {$+1$} -| (0,R) node[above] {$\mathbb{Z}/n\mathbb{Z}$};
 \path (135:R/2) node {$\QNR$} (-90:R/2) node  {$\QNRP$} (0:R) node[right]   {$-1$} ;

enter image description here

  • +1 for declare function! I have not been aware for this possibilitiy.
    – Zarko
    Commented Jun 5, 2019 at 22:27
  • @Zarko Thanks! Note that there is one possible caveat: it is somewhat less straightforward to "undeclare" functions, though possible. That is, if you use several of those in your tikzpictures, try to use them locally in scopes. Never declare them globally outside the tikzpicture.
    – user121799
    Commented Jun 5, 2019 at 22:39
  • thank you for info. For purpose as declare function is used in your answer so far I use \def\R{...}, which also have some limitations.
    – Zarko
    Commented Jun 5, 2019 at 22:54
  • @Zarko Yes, sure. You should never define single-letter macros. For instance, xelatex defines some of those without telling you. The above was just a remark that one may not overdo it with these declare functions, but here it is fine IMHO.
    – user121799
    Commented Jun 5, 2019 at 23:00

a small variation of @marmot answer:

\documentclass[tikz, margin=3mm]{standalone}


\begin{tikzpicture}[declare function={R=16mm;}]
\node[circle, draw, fill=yellow!30, minimum size=2*R,
      label=left: $+1$,
      label=$\mathbb{Z}/n\mathbb{Z}$] (C) {};
\draw[fill=green!30] (C.south) arc (270:90:R);
\draw (C.west) arc (180:90:R) |- cycle;
\node[below=R/2mm]        {$\QNRP$};
\node[above left=R/2mm]   {$\QNR$};


enter image description here


A pstricks solution:

\documentclass[border=5pt, svgnames]{standalone}
\usepackage{pst-node, pstricks-add}



\psChart[userColor={Yellow!50, LightSteelBlue!80, LightSteelBlue!80,Yellow!50,}]{1,1,1,1}{}{2}
\rput[B](1.1;140){\QR} \rput[B](1.1;-90){\QNR}
\uput[u](2;90){$\mathbb{Z}/ n\mathbb{Z}$}


enter image description here

You must log in to answer this question.

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