# Plot 3 variables in view similiar to ArrayPlot

Is there any function to plot vectors in form $(x,y,z)$ where first coordinate is X value, second- Y value and color of square represents third coordinate? It should look like ArrayPlot.

Here is a sample of my data (http://pastebin.com/nHprReDu) and the results I obtain using ListDensityPlot:

ListDensityPlot will deal with data in that format. An interpolation order of zero will reproduce the "blocky" ArrayPlot output as well.

data = Flatten[Table[{x, y, Sin[x] + Sin[y]}, {x, -3 Pi, 3 Pi}, {y, -3 Pi, 3 Pi}], 1];
ListDensityPlot[data, InterpolationOrder -> 0]


Thank you for posting your data. Unfortunately, the data you have is not regularly sampled, hence the irregular shapes in the ListDensityPlot. However, you can interpolate and resample if you want "square" blocks. Below, data is your data from pastebin.

if = Interpolation[data];
ListDensityPlot[
Flatten[Table[{x, y, if[x, y]}, {x, 1, 23, 2}, {y, 1, 14}], 1],
InterpolationOrder -> 0
]


• Thank you for idea, but in my case it returns not only squares, what's weird because values are different – pupilx Jan 26 '17 at 22:16
• @pupilx You should add your data and the results in the question, so we can compare results. – MarcoB Jan 26 '17 at 22:18
• Please see my edit – pupilx Jan 26 '17 at 22:31
• @pupilx Thank you for the data. I have amended my answer. Take a look at the new version. – MarcoB Jan 26 '17 at 22:41
• Thank you, it helps me a lot. The most important for me is not to lose information if value < 1, because then I need to construct true/false matrix , will it be ok? – pupilx Jan 26 '17 at 22:47