I have:

List of points on 2D plane:

pointsz0 = ToExpression@Import@"http://pastebin.com/raw.php?i=VQfP0HgB";

And I have some values in those numbers:

table = ToExpression@Import@"http://pastebin.com/raw.php?i=7g4QNPPw";

Now since pointsz0 are only 2D (notice z = 0), I would like to create a 2D graph. At a point[[1]] I want table[[1]].

To make things a bit more clear. My numbers are actually vector norms and I would like to make a nice graph showing how the norm of a vector changes in given points. Most likely using colors. That's the idea.


If I understood you correctly you can use ListDensityPlot:

pointsz0 = ToExpression@Import@"http://pastebin.com/raw.php?i=VQfP0HgB";
table = ToExpression@Import@"http://pastebin.com/raw.php?i=7g4QNPPw";
ListDensityPlot[Append[pointsz0[[#, ;; 2]], table[[#]]] & /@ Range@Length@table]

Mathematica graphics

| improve this answer | |
  • $\begingroup$ This will do the job, yes! Thank you! $\endgroup$ – skrat Sep 7 '14 at 11:41
  • $\begingroup$ You can still look into the ListDensityPlot options if you want fancy colours, I don't know what you are into :) $\endgroup$ – Öskå Sep 7 '14 at 11:42
  • $\begingroup$ @skrat You could also use ListContourPlot. $\endgroup$ – Öskå Sep 7 '14 at 11:54
  • $\begingroup$ One more question: I have to make three of those, and I prefer ListContourPlot. But the thing is, that I would like to use the same scale (same legend) for all of the three graphs. Meaning is 1 is white and 0 is blue, I want this to be legend for all the three graphs. How do I do that? $\endgroup$ – skrat Sep 7 '14 at 15:13
  • $\begingroup$ And, this is of z=0... What would the code be if x=0 or y=0? I can't guess it right.. $\endgroup$ – skrat Sep 7 '14 at 15:58

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.