1

Is it possible to move the legend of the pie-chart under the figure instead of having it on the side? Moreover, how can I label and add a caption for each piechart?

I want to piechart one next to each other as the one show below:

\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{eurosym}
\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}
%\usepgfplotslibrary{external}
%\tikzexternalize
\usepackage{verbatim}
\usepackage{pgf-pie}
\usepackage{tikz}
\usepackage{subfigure}

\begin{document}
\begin{tikzpicture}
  \pie [rotate = 180]
    {62/\TeX\ Live and Mac\TeX,
     32/MiK\TeX\ and Pro\TeX t, 6/Other \TeX}
      \pie [rotate = 180]
    {60/\TeX\ Live and Mac\TeX,
     34/MiK\TeX\ and Pro\TeX t, 6/Other \TeX}
\end{tikzpicture}


\begin{tikzpicture}
\tikzset{lines/.style={draw=white},}
\pie[color={purple, red, yellow, blue, green},sum=auto, after number=,text=legend,every only number node/.style={text=black},style={lines}]{10/A,20/B,30/C,10/D}
\pie[pos={8,0},color={purple, red, yellow, blue, green},sum=auto, after number=,every only number node/.style={text=black},style={lines}]{10/,20/,30/,10/}

\end{tikzpicture}



\end{document}
  • Legend and caption is same as for any other figure/diagram: figure environments and \captions. Or one figure with subfigures. (Note by the way that the subfigure package is considered deprecated, better to use the subcaption package.) – Torbjørn T. Dec 19 '16 at 12:37
  • Okey, but is it possible to move the legend of the piechart in the bottom of the figure? – Alexis Charalambis Dec 19 '16 at 12:48
  • The answer to that is very likely yes. But I don't know how pgf-pie sets up the legend, and I don't have time to look at the code right now. – Torbjørn T. Dec 19 '16 at 12:55
  • Solved. Similar question: http://tex.stackexchange.com/questions/338528/how-to-put-small-numbers-outside-the-pie-slices-without-making-a-mess – Alexis Charalambis Dec 19 '16 at 14:31

0 Answers0