I need to plot the following diagram:


But how I do not know any of the packages

  • datatool,
  • PGF/TikZ,
  • PSTricks,
  • datapie.

I know how to do simple pie charts with datapie, but this one it a bit tricky.

  • Any half-decent plotting application will allow you to export in vector graphics. Even excel can be converted (saved as or printed to) to pdf, which if necessary can be tweaked using inkscape. And if even that's not possible, you should prefer .png over .jpg for diagrams. That said, one of the many knowledgeable people here will be able to help you - but why not show what you've tried so far?
    – Chris H
    Jan 31, 2014 at 11:46
  • I don't know how to do pie charts, but if you are able to create the individual concentric rings, it is possible to concentrically overlay them. As Chris H suggested, show us what you have tried. Jan 31, 2014 at 11:48
  • I have not tried anything special. I am looking for special package if has been ever written. Sometimes it is difficult to find approperite package. So I've decided to ask. Chris H is right I will use or png or pdf or eps formats if there is no package which can solve this problem.
    – saldenisov
    Jan 31, 2014 at 11:58
  • 2
    Best avoid pie charts as the visual information can be very misleading...see section 7.6 Plots and Charts of the PGF manual, especially the graphic on Kohle is am wichstigen
    – Leeser
    Jan 31, 2014 at 12:03
  • 1
    I don't understand how to read this pie chart. It looks as if you count the blue ring inside and outside as part of the same group, but it is tricky to add them together by eye. I had the first impression that we add the areas of the two blue regions, but I suppose you add their lengths, which is not as easy by eye. Could you please try a bar graph instead, to make it easier to read? Jan 31, 2014 at 13:39

2 Answers 2


Update: Applying wheelchart package

With package wheelchart previous code can be simplified to


\newcommand{\WClegendrow}[2]{\tikz\filldraw[fill=#1] (0,0) rectangle (.3,.3); & #2 (years)\\}
    slices style={\WCvarB, draw=black, thick},
    legend entry={
        \node[anchor=west, label={[text width=3cm, align=center]How many years experience do you?}] at (3.5,0) {%
    slices style={\WCvarB, draw=black, thick},
    ]{18/yellow/{over 25},8/violet/20,0/brown!25/15,
\draw (0,0)--++(up:3.5);
\draw (0,1)--++(right:.2) node[right]{No};
\draw (0,2.5)--++(right:.2) node[right]{Yes};

enter image description here

Original answer:

Just for fun, a TikZ solution inspired by Jake's wheelchart:


% The main macro
% #1 - List of value/color pairs
% #2 - inner radius
% #3 - outer radius
    % Calculate total
    \foreach \value/\colour in {#1} {

    % Calculate the thickness and the middle line of the wheel

    % Rotate so we start from the top
    % Loop through each value set. \cumnum keeps track of where we are in the wheel
        \foreach \value/\colour in {#1} {
            \pgfmathsetmacro{\newcumnum}{\cumnum + \value/\totalnum*360}

      % Draw the color segments.
            \draw[fill=\colour] (-\cumnum:#2) arc (-\cumnum:-\newcumnum:#2)--(-\newcumnum:#3) arc (-\newcumnum:-\cumnum:#3)--cycle;

       % Set the old cumulated angle to the new value


% Usage: \wheelchart{<value1>/<colour1>, ...}{inner radius}{outer radius}

\wheelchart{25/brown!70, 60/blue!70}{3cm}{4.5cm}

\draw[thick] (0,0)--(90:5cm);
\draw[thick] (0,1.25cm)--++(0:3mm) node[right] {No};
\draw[thick] (0,3.75cm)--++(0:3mm) node[right] {Yes};

\draw[line width=3mm,blue!70] (0,1) -- ++(0:3mm) node[right, black] {5 years};
\draw[line width=3mm,green!70] (0,.5) -- ++(0:3mm) node[right, black] {10 years};
\draw[line width=3mm,brown!70] (0,0) -- ++(0:3mm) node[right, black] {15 years};
\draw[line width=3mm,purple!70] (0,-.5) -- ++(0:3mm) node[right, black] {20 years};
\draw[line width=3mm,yellow!70] (0,-1) -- ++(0:3mm) node[right, black] {Over 25 years};

\node[anchor=west] at (-.5,-3) {Pie Slices show Count};
\node[anchor=west, align=center] at (-.5,3) {How many years\\ experience do you};


enter image description here


A solution using PSTricks:



% marcos
    fillcolor = #1,
    linewidth = 0.5\pslinewidth
  ](5,#2)(!5.4 #2 0.4 add)
  \uput[0](!5.4 #2 0.2 add){\small #3}}
  \psRing[fillcolor = blue!70](0,0)[#1,#2]{0.5}{2}
  \psRing[fillcolor = green!70](0,0)[#2,#3]{0.5}{2}
  \psRing[fillcolor = purple!70](0,0)[#3,#4]{0.5}{2}
  \psRing[fillcolor = yellow!70](0,0)[#4,#1]{0.5}{2}}
  \psRing[fillcolor = blue!70](0,0)[#1,#2]{3}{4.5}
  \psRing[fillcolor = brown!40](0,0)[#2,#1]{3}{4.5}}

% parameters


\psset{unit = 0.7, fillstyle = solid}
  \psaxes[labels = none, ticks = none](0,0)(0,5)
  % inner ring
  \uput[0](0.2,1.25){\small No}
  % outer ring
  \uput[0](0.2,3.75){\small Yes}
  % legends
  \legend[yellow!70]{-1}{Over $25$~(years)}
  % text
    \small How many years\strut\\[-1ex]
    \small experience do you\strut}}
  \rput(7,-3.5){\footnotesize Pie Slices show Count}



Note that all you have to do is enter the absolute values for each of the parameters and then the diagram will be drawn automatically. (Note that you have to choose the start angle of the first pie slice relative to horizontal; in the diagram above, it is 90 degrees.)

  • For some reason it shows error that all functions are not defined...
    – saldenisov
    Jan 31, 2014 at 13:14
  • As far as I understood. I should use LaTeX compile not PDFLaTeX comiler in TexStudio I'm using. I've changed, but the same problem. Could you describe in details what I could do with that?
    – saldenisov
    Jan 31, 2014 at 13:21
  • 1
    If you are using MikTeX on Windows, try the MikTeX Update program docs.miktex.org/manual/updating.html. If you are using Ubuntu, click the Super key and type update, and click on Software Updates. Jan 31, 2014 at 13:42
  • Updating helped. It looks like the pstrick package were one year old, and it was the problem.
    – saldenisov
    Feb 1, 2014 at 18:10
  • Is it possible to use pstrick package with standalone? When I use in stadalone, created pdf page has format of A4, but I want to have size of the picture. What can be the solution?
    – saldenisov
    Feb 2, 2014 at 12:58

You must log in to answer this question.

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