I'm a LaTeX rookie so I'm hoping someone will be able to help me. I've been stuck with this figure for quite some time and haven't found a solution.

Specifically, I have made 2 pie charts next to each other with a joined legend. The default option seems to stack the legend box in between the charts. How do I:

  1. Move the legend down south to underneath the boxes (I've try \legend.style which did not seem to do anything)
  2. Add a text to the top of each box to specify which group the data comes from (i.e. label Group 1 for the left box, and Group 2 for the right box).

Thank you very much for your help!

My MWE is:




\pie [square, scale font,
            color = {blue!10, blue!20, blue!40}, sum=auto, text=legend, after number = {\%}, every only number node/.style={text=black},style={lines}]{58/Unidentifiable ML,25/MOP only,11/SMO only,6/MOP \& SMP} 

\pie [pos={11,0}, square, scale font,
            color = {blue!10, blue!20, blue!40}, sum=auto, after number = {\%},every only number node/.style={text=black},style={lines}]{56/,18/,10/,16/}

\caption{How do I move the legend down south}


I think bar chart or circular chart is more convenient, but if you stick to that kind of rectangles, then below is a way with plain TikZ. Plain TikZ makes controls easier. Other thing I like in this figure is that it illustrates the way of TikZ drawing: putting node and pic along path.

enter image description here

\fill[#1] (-.2,-.2) rectangle (.2,.2);

(0,0)     pic[fill=blue!10]{box} node[right=2mm]{MOP \& SMP}
++(90:.6) pic[fill=blue!20]{box} node[right=2mm]{SMO only}
++(90:.6) pic[fill=blue!30]{box} node[right=2mm]{MOP only}
++(90:.6) pic[fill=blue!40]{box} node[right=2mm]{Unidentifiable ML};

\fill[#1,draw=#2] #3 rectangle #4;
\path ($.5*#4+.5*#3$) node[scale=#5]{#6};

\begin{scope}[shift={(180:7)},scale=6,local bounding box=L]
\path (L.north) node[above,scale=2]{\bfseries Group 1};

\begin{scope}[shift={(0:4.5)},scale=6,local bounding box=R]
\path (R.north) node[above,scale=2]{\bfseries Group 2};
  • 1
    This works beautifully! Thank you 3000! – teadrinker64 Aug 10 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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