0
$\begingroup$

I wonder how can I draw 256 hexagons inside a big hexagon? I want the 256 hexagons to have different colours, namely: 1 black, 8 red, 28 blue, 56 orange, 70 green, 56 yellow, 28 purple, 8 cyan, and 1 grey.

$\endgroup$
  • $\begingroup$ Can you be clearer about the goal? Is the big one composed of them or they are just inside? Do their positions matter? Have you tried anything? $\endgroup$ – Kuba Oct 26 '18 at 11:43
  • 2
    $\begingroup$ If you have a specific layout in mind you should tell; 256 is not a centered hexagonal number which would be the most obvious starting point to think of. $\endgroup$ – kirma Oct 26 '18 at 11:46
  • $\begingroup$ I am trying to put them inside, I am not sure if 256 can be composed as 256/6 is not a round number. Each colour group should sit next to each other with the order I wrote. I am very new to Graphics package the only thing I tried is Graphics[Polygon[CirclePoints[6]]] but I have no idea on how to proceed $\endgroup$ – William Oct 26 '18 at 11:47
2
$\begingroup$

A hexagon cannot be broken into 256 smaller hexagons. It can be broken into 217 (if each edge has 9 small ones) or 271 (if each edge has 10 small ones).

Such plots are easy to make with the IGLatticeMesh function of IGraph/M.

IGLatticeMesh["Hexagonal", Polygon@CirclePoints[9, 6]]

enter image description here

The result is a MeshRegion. You can colour cells using the MeshCellStyle option. It is unclear from your question how you want to colour them.

$\endgroup$

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.