I was browsing through the new features of Mathematica 11 and found this picture on the website:


I'm trying to replicate this graphic (except for the logo in the middle of course) by means of the SectorChart function, but it seems very difficult to make it work. I got as far as this (only choosing a few sectors for demonstration purposes):

  size1 = 20; size2 = 8;
secDat = Table[{1, 1}, {x, 1, size2}, {y, 1, size1}];
SectorChart[secDat, ChartLayout -> "Grouped", 
 PerformanceGoal -> "Speed", SectorOrigin -> {Automatic, 10}, 
 ChartLabels -> 
  Placed[Table["Label" <> ToString@x, {x, 1, size1}], "RadialInside", 
   Rotate[#, 90 Degree] &], 
 ChartLegends -> 
  Placed[Table["Legend" <> ToString@x, {x, 1, size2}], Below]]

Can someones help me with

  1. aligning the labels such that they are in line with the grid lines like shown in the graphic. I tried to use the Rotate function but it rotates all labels
  2. only showing the labels in the inner most layer
  3. finding a way to automatically color only specific sections and not others like it is shown in the graphic

Any help appreciated!

  • 1
    $\begingroup$ See SectorChart. $\endgroup$ – Kuba Jul 27 '17 at 10:40
  • 2
    $\begingroup$ Searke says: "What makes you so sure it was written 100% in Wolfram Language Code? Things like this tend to go thru design and are edited to fit in more with the style of the webpage." $\endgroup$ – J. M. is in limbo Jul 27 '17 at 10:45
  • $\begingroup$ Thanks all, I guess I just assumed it was made with Mathematica :). Sector Chart seems a possible way, but also looks quite different as in the picture. Any ideas how to start creating a chart like that with SectorChart? $\endgroup$ – holistic Jul 27 '17 at 10:50
  • 2
    $\begingroup$ You could start with ChartLabels -> Placed[Automatic, "RadialInside",Rotate[#,somefunction]&], SectorOrigin -> {Automatic, 4} in Sector chart $\endgroup$ – Ruud3.1415 Jul 27 '17 at 11:26
  • 1
    $\begingroup$ It could also just be a PieChart with opactities set and the logo / dashed lines added on top. $\endgroup$ – b3m2a1 Jul 30 '17 at 23:59

You could use Graphics and built it up yourself. One way to start may be:

Options[versionChart] = {
  LabelStyle -> Directive[White, Medium],
  GridLinesStyle -> Directive[Thick, Gray],
  ImageSize -> Large,
  ColorFunction -> ColorData[92],
  "CoreSize" -> 20

versionChart[data_,OptionsPattern[]] := With[{
    layers = Union@Flatten[Last/@data],
    elementCount = Length@DeleteDuplicates@Flatten[First/@data],
    innerDiskSize = OptionValue["CoreSize"]
      (* draw inner part (except labels) *)
      (* generate sectors *)
      (* first, Table over all layers *)
        (* for each layer, check which elements are active on this layer *)
        With[{elems=Flatten@Position[data,{_, _?(MemberQ[#,layer]&)}]},
          (* Table through all active elements *)
            (* set the sector color *)
            (* draw the sector *)
            Annulus[{0,0}, layer + innerDiskSize + {0,1}, {e-1/2, e + 1-1/2} 2 \[Pi] / elementCount],
            (* draw labels *)
              (* avoid upside-down labels *)
                Rotate[Text[Style[data[[e,1]], OptionValue[LabelStyle]],{-(innerDiskSize-1/2),0},{-1,0}],angle+\[Pi],{0,0}],
                Rotate[Text[Style[data[[e,1]], OptionValue[LabelStyle]],{(innerDiskSize-1/2),0},{1,0}], angle, {0,0}]
          }, {e,elems}]
          (* draw intersection lines *)
          {OptionValue[GridLinesStyle], Line[Outer[Times,(innerDiskSize + layer + {0.2,0.8}), AngleVector[2\[Pi] (n-1/2)/elementCount]]]},
          {n, elementCount}
          (* draw MMA polygon *)
            CirclePoints[{0.5 innerDiskSize,0},5],
            CirclePoints[{0.3 innerDiskSize,30 Degree},5]
    ImageSize -> OptionValue[ImageSize]

Careful: this code is not super-robust, i.e. I do not check if the user gave good arguments and options. You may want to add this yourself, but for this post I think it is best if my code remains "clutter-free".

versionChart expects a List as argument, which shall be of the form {{label1, {layerlist1}}, {label2, {layerlist2}}, ...}, where the layerlists are integers (incl. 0), and signify on which layers this data should have a sector. For example

  {"uniform", {0, 4}},
  {"beta", {1, 3}},
  {"gamma", {0, 2}},
  {"delta", {3, 5}}


simple example output


versionChart[{#, RandomChoice[Range[0, 5], 3]} & /@ Names["*Distribution"],
 LabelStyle -> 
     FontSize -> Scaled[0.01], 
     FontFamily -> "Comic Sans"
  "CoreSize" -> 50,
  ColorFunction -> ColorData[93],
  ImageSize -> 2000,
  GridLinesStyle -> Gray


enter image description here

For export, you may want to use Rasterize with a high setting for ImageResolution, so the text does not get scrambled.

  • $\begingroup$ Interesting solution, thank you! Yes, it looks quite similar to graphics. Can you also add some grid lines? $\endgroup$ – holistic Jul 31 '17 at 13:49
  • $\begingroup$ @holistic I added grid lines. Do you also want the star in the inside to look like the one in your figure? Or is this irrelevant? $\endgroup$ – JEM_Mosig Jul 31 '17 at 21:30
  • $\begingroup$ No, it's fine like that ;)...Awesome! Thank you!! $\endgroup$ – holistic Jul 31 '17 at 21:53
  • 1
    $\begingroup$ Wow! My enthusiasm, however, is tempered by your font choice. $\endgroup$ – J. M. is in limbo Aug 1 '17 at 2:40

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.