Message Boards Message Boards

0
|
292 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

ListDensityPlot3D data not dealing with tiny numbers

Posted 9 days ago

I've read in data from a PDE solver which has (x, y, z) and value. I grouped the single list into 4 values each using data = ReadList[..., Real]; p = Partition[data, 4]; I then tried ListDensityPlot3D[p], but this gave me a division by zero error because of an Opacity problem, so I tried

ListDensityPlot3D[p, OpacityFunction -> Opacity[.25],  PlotRange -> All]

which runs for a while and then comes up with an empty plot.

The fourth value in the list is mostly zeros except for the central region which has values in the range of +/- 1e-5. Is there a command which will scale the values into a range ListDensityPlot3D is happy with, or is there an option to let the function know the values are tiny?

POSTED BY: Mike Rosing
3 Replies

You may try a logarithmic rescaling of the actual values of p, or indirectly with a ColorFunction.

POSTED BY: Gianluca Gorni
Posted 8 days ago

I tried ColorFunction, but maybe I don't understand how to use it. I can post process the numbers to scale them though, before messing with Mathematica. Log(-x) is imaginary, so that complicates things. Thanks, I was hoping I was missing something obvious, but a little more work to make the numbers nice won't be that difficult.

POSTED BY: Mike Rosing

If your data for f are all positive you may try ColorFunction -> Function[{x, y, z}, Hue[Log[z]].

If the minimum value of f is negative, try something like ColorFunction -> Function[{x, y, z}, Hue[Log[z-2*minimumValue]].

POSTED BY: Gianluca Gorni
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