I'm plotting densities of simulated eruptions. I have an issue that the high density at the top and bottom of the plot blocks out any detail in the middle of the plot (where the interesting stuff is going on). This is true for most ranges of the plot.

I was hoping to alter the colourfunction scaling, (I was imagining a gaussian centred in the middle of the plot", however, there are issues as I get the error "Too many parameters in {x,y,z} to be filled from ...". I'm not sure this is the right route to go down.

So far my plot is reproduced as follows:

ListDensityPlot3D[-data, PlotLegends -> Automatic, 
 ColorFunction -> "DarkRainbow", Boxed -> False]

enter image description here

Data available here [10mb]: https://ufile.io/9c858

Any advice or comments appreciated.


Code which produced error was just my attempt to make a dependence on z.

ListDensityPlot3D[-data, PlotLegends -> Automatic, 
 , ColorFunction -> Function[{x, y, z}, Hue[z]], Boxed -> False]


How to read data:

Place data.csv in current directory,

files = FileNames["*csv"];
importfiles = Import[files[[1]]]

(*For Low Res*) 
data = ArrayReshape[importfiles, {74, 60, 55}]

(*For High Res*)
data = ArrayReshape[importfiles1, {129, 105, 97}];
  • $\begingroup$ Use PlotStyle -> Opacity[0.5]. $\endgroup$ – David G. Stork Mar 6 '17 at 21:47
  • $\begingroup$ show what you did that produced that error. $\endgroup$ – george2079 Mar 6 '17 at 21:55
  • $\begingroup$ I cannot download the enormous file, and hence provided an approach that has worked in other contexts. $\endgroup$ – David G. Stork Mar 6 '17 at 22:00
  • $\begingroup$ I will rerun the simulation again at a lower resolution, however, there is an significant effect when running a lower resolution that there is little defined jetting motion to find. I have updated the questions. $\endgroup$ – Tomi Mar 6 '17 at 22:27
  • $\begingroup$ I think the solution is to use the OpacityFunction - I just need to work out how to select certain values to make opaque. $\endgroup$ – Tomi Mar 6 '17 at 23:49

A fix to draw out detail is the following:

ListDensityPlot3D[data, ColorFunction -> "DarkRainbow", 
 PlotLegends -> Automatic, PlotRange -> {1, 4500}, 
 OpacityFunctionScaling -> False, 
 OpacityFunction -> Interval[{100, 2000}, {3300, 4500}]]

Noting that OpacityFunction makes those values more opaque. I have not yet worked out how to give an exact value for the opacity for those intervals.

If you look carefully, the grey bar on the legend corresponds to the opacity, on my question - the important areas had their opacity set to near 0.

enter image description here


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.