Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Represent an array as polyomino regions
ResourceFunction["PolyominoPlot"][mat] for matrix mat, aggregates adjacent identical values and plots the result as a configuration of polyominoes. |
Plot a chair tromino next to a monomino:
| In[1]:= |
| Out[1]= | ![]() |
Plot two chair trominoes next to three monominoes:
| In[2]:= |
| Out[2]= | ![]() |
A random polyomino plot over four values:
| In[3]:= | ![]() |
| Out[3]= | ![]() |
Add color by setting ColorRules:
| In[4]:= | ![]() |
| Out[4]= | ![]() |
Colors can also be added by setting ColorFunction:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Override the edge style interior to Graphics:
| In[6]:= |
| Out[6]= | ![]() |
PolyominoPlot differs from ArrayPlot in its ability to draw region boundaries:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Unlike ArrayPlot, colors are not strictly necessary:
| In[8]:= | ![]() |
| Out[8]= | ![]() |
PolyominoPlot can achieve finer results than ArrayMesh:
| In[9]:= |
| Out[9]= | ![]() |
Plot a solution to Scott's pentomino problem:
| In[10]:= | ![]() |
| Out[10]= | ![]() |
Plot a solution to the heart puzzle:
| In[11]:= | ![]() |
| Out[11]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License