Question: I am using the package pgf-pie and want to have two pie charts next to each other but using the same legend. How can I have the legend centered below the two charts?

Mini example:

```
\documentclass[tikz,border=10pt]{standalone}
\usepackage{pgf-pie}
\begin{document}
\begin{center}
\begin{minipage}{.45\textwidth}
\begin{tikzpicture}
\tikzset{lines/.style={draw=white},}
\pie[color={viola, rosso, giallo, blu, verde},sum=auto, after number=,text=legend,every only number node/.style={text=black},style={lines}]{10/A,20/B,30/C,10/D}
\end{tikzpicture}
\end{minipage}
\begin{minipage}{.45\textwidth}
\begin{tikzpicture}
\tikzset{lines/.style={draw=white},}
\pie[color={viola, rosso, giallo, blu, verde},sum=auto, after number=,text=legend,every only number node/.style={text=black},style={lines}]{10/A,20/B,30/C,10/D}
\end{tikzpicture}
\end{minipage}
\end{center}
\end{document}

```

This example plots two pie charts side by side but each with a single legend.

Answer: 
According [`pgf-pie`](http://texdoc.net/pkg/pgf-pie) documentation you can use `pos` option to place a `pie` inside a `tikzpicture`. You don't need `minipage`.

And also from examples, seems that a second parameter inside values list (`10/A, 20/B`) adds names to pie. If you don't want a second legend, write a values list with empty names. If the order is correct, the first legend will serve.

```
\documentclass[border=10pt]{standalone}
\usepackage{pgf-pie}
\begin{document}
\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}

```

[![enter image description here](https://i.stack.imgur.com/zAqJ0.png)](https://i.stack.imgur.com/zAqJ0.png)
With the `subfigure` package.
I have not the `pgf-pie` package, so I can not test it, but this code should work :

```
\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usepackage{pgf-pie}
\begin{document}
\begin{center}
\begin{figure*}[t!]
    \centering
    \begin{subfigure}[b]{0.5\textwidth}
        \begin{tikzpicture}
        \tikzset{lines/.style={draw=white},}
        \pie[color={viola, rosso, giallo, blu, verde},sum=auto, after number=,text=legend,every only number node/.style={text=black},style={lines}]{10/A,20/B,30/C,10/D}
        \end{tikzpicture}
    \end{subfigure}%
    ~ 
    \begin{subfigure}[b]{0.5\textwidth}
        \begin{tikzpicture}
        \tikzset{lines/.style={draw=white},}
        \pie[color={viola, rosso, giallo, blu, verde},sum=auto, after number=,text=legend,every only number node/.style={text=black},style={lines}]{10/A,20/B,30/C,10/D}
        \end{tikzpicture}
    \end{subfigure}
    \caption{Caption place holder}
\end{figure*}
\end{center}
\end{document}

```