Message Boards Message Boards

0
|
3070 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

ListLogPlot3D - possible ?

Posted 9 years ago

How can I make a ListLogPlot3D with Mathematica? Is it possible?

POSTED BY: Andrea Burlon
4 Replies
Posted 9 years ago

This can likely be improved, but:

data = Flatten[
   Table[{x, y, 220 - x^2 - y^2}, {x, -10, 10}, {y, -10, 10}], 1];

listLogPlot3D[data_, opts___] := Module[{logData, zDivisions, zTicks},
  logData = 
   Select[data, #[[3]] > 0 &] /. {x_, y_, z_} -> {x, y, Log10[z]};
  zDivisions = 
   Select[FindDivisions[MinMax[data[[All, 3]]], 10], # > 0 &];
  zTicks = {Log10[#], #} & /@ zDivisions;
  ListPlot3D[logData, Ticks -> {Automatic, Automatic, zTicks}, opts]
  ]

listLogPlot3D[data, AspectRatio -> 1]

enter image description here

(Sorry, Sander. We were both working at the same time. ;-) )

POSTED BY: David Keith

No worries, it happens sometimes ;) Very similar solution!

POSTED BY: Sander Huisman
POSTED BY: Sander Huisman

If you have an older version of Mathematica (version <10). Use Flatten[......... ,1] instead of Catenate. And if you have a version <7 you don't have Log10 so you have to make your own...

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract