# Mapping a list into a phase diagram

Consider the following list

list = {{1,1,1},{1,2,1},{1,3,2},{1,4,2},
{2,1,1},{2,2,2},{2,3,2},{2,4,2},
{3,1,1},{3,2,2},{3,3,3},{3,4,3},
{4,1,2},{4,2,3},{4,3,3},{4,4,3}};


The list is composed of sublists in the form of {x,y,value}, where the first and second element are the coordinates, and the third element is a value which should be assigned in the phase diagram.

In the example above, I would a different color to be assigned to a different number (say 1 - blue, 2 - red, 3 - green).

The result should look like the following

This is a simplified example of a much larger data set, with very small spacings between the {x,y} values, which should eventually produce several colors that represent phases.

• Why do you call this a "phase plot"? Mar 26 '19 at 20:10
• @Stork, changed to phase diagram, if u know a better terminology please edit. Mar 27 '19 at 7:13

E.g.

Graphics[{{Blue, Red, Green}[[#3]], Disk[{#2, #}, 1/3]} & @@@ list,
AxesOrigin -> {1, 1}/2, FrameStyle -> FontSize -> 28,
FrameTicks -> {Range[4], Range[4], None, None}, Frame -> True,
FrameLabel -> {Style["Y", 24], Rotate[Style["X", 24], -90 °]}]


• Perhaps it is personal preference, but would it be better practice to use the option RotateLabel -> False rather than rotate the "X" label manually?
– user40265
Mar 27 '19 at 2:23

This approach might appeal

BubbleChart[list /. {x_, y_, z_} -> {y, x, z},
BubbleSizes -> {0.25, 0.25},
ColorFunction ->
Function[{x, y, r},
Switch[{x, y, r}, {_, _, 1}, Blue, {_, _, 2}, Red, {_, _, 3},
Green]], ColorFunctionScaling -> False,
FrameTicks -> {Range[4], Range[4], None, None}, Frame -> True,
FrameLabel -> {"Y", "X"}, RotateLabel -> False]


You can adjust the space between bubbles by changing the BubbleSizes.