5
$\begingroup$

Here is my code:

data = Table[{i, j, RandomInteger[{1, 10}]}, {i, 5}, {j, 5}];
thePlot = ListPlot3D[Flatten[data, 1], InterpolationOrder -> {0}]

How can I make the data at one point, say (3,4), a different color. I want to highlight that data.

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 0) Browse the common pitfalls question 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Dr. belisarius Mar 8 '16 at 17:43
7
$\begingroup$
SeedRandom[69];
data = Table[{i, j, RandomInteger[{1, 10}]}, {i, 5}, {j,  5}];      
ListPlot3D[Flatten[data, 1], InterpolationOrder -> 0, 
          ColorFunctionScaling -> False, 
          ColorFunction -> Function[{x, y, z}, 
                            If[ChessboardDistance[{x, y}, {3, 4}] <= .5 && 
                               z == Last@data[[3, 4]], Red, Blue, Green]]]

Mathematica graphics

| improve this answer | |
$\endgroup$
5
$\begingroup$
thePlot = 
 Show[ { ListPlot3D[Flatten[data, 1], InterpolationOrder -> {0}], 
   Graphics3D[{Red, 
     Cuboid[# - {0, 0, 1/100}, # + {1/2, 1/2, 1/100}] &@
      Flatten[data, 1][[3]]}]
   }]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ your solution is robust. $\endgroup$ – garej Mar 8 '16 at 6:35

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.