counts = {0.18, 0.51, 0.31};

PieChart[counts, ChartLabels -> counts, PlotRange -> All,   Frame -> True, FrameTicks -> None]

I am completely puzzled how can I achieve a format like that of the following Figure.

enter image description here

  • $\begingroup$ Are you just interested in reproducing the figure, or do you need to do this programmatically for a number of data sets? $\endgroup$ – MarcoB Feb 9 at 21:22
  • $\begingroup$ @MarcoB I want to do for other data sets as well. But instead of describing what I want, I thought it was a better idea to provide this figure as a guideline. (Thanks for your comment) $\endgroup$ – Dimitris Feb 9 at 21:27
counts = {0.18, 0.51, 0.31};
n = 600;
labels = Placed[Row /@ Thread[{Quantity[Round[100 counts], "Percent"], 
    " (" <> ToString@# <> "H)" & /@ Round[ n counts]}], "RadialOutside"];
legend = Placed[SwatchLegend[Automatic, Row /@ Thread[{{"CM ", "TD ", "TP "}, 
    Row[{"(", #, ")"}] & /@ Quantity[Round[100 counts], "Percent"]}]], 
   {After, Bottom}, Framed];

Framed[PieChart[counts, ChartLabels -> labels, ChartLegends -> legend, PlotRange -> All]]

enter image description here

  • $\begingroup$ Thank you for your answer! Exactly what I wanted. Just a question, How can I modify the associated text (in legend and in pie chart) show that it appears with the following option Style["x", FontSize -> 12, FontFamily -> "Latin Modern Roman", FontColor -> Black] where "x", e.g. 18% (108H) or CM (18%) and so on. $\endgroup$ – Dimitris Feb 10 at 12:23
  • $\begingroup$ @dimitris, you can add the option LabelStyle -> {FontSize -> 12, FontFamily -> "Latin Modern Roman", FontColor -> Black} to SwatchLegend. $\endgroup$ – kglr Feb 10 at 12:28
  • $\begingroup$ Thanks for your quick feedback. It works as desired but this affects only the associated SwatchLegend. I want also to affect accordingly the associated text that accompanies each pie. $\endgroup$ – Dimitris Feb 10 at 12:33
  • $\begingroup$ @dimitris, add the same option to PieChart. $\endgroup$ – kglr Feb 10 at 12:39
  • $\begingroup$ Perfect! Thanks a lot. $\endgroup$ – Dimitris Feb 10 at 12:57

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.