small values result in empty isosurface plot

2 ビュー (過去 30 日間)
Jessica
Jessica 2011 年 2 月 16 日
回答済み: cr 2018 年 10 月 5 日
I am trying to display 4D data (x,y,z,value) via an isosurface plot. The values are quite small as they represent pollution particulates in the atmosphere. The data range from 1 run is:
minimum value = 0.0280 maximum value = 0.1399
When I generate the isosurface, the plot comes up empty. Are these values too small to plot in this way or am I missing some vital setting?

回答 (3 件)

Andreas Goser
Andreas Goser 2011 年 2 月 16 日
In order to see whether this is depending on your data, please run the example from the documentation:
[x,y,z,v] = flow;
p = patch(isosurface(x,y,z,v,-3));
isonormals(x,y,z,v,p)
set(p,'FaceColor','red','EdgeColor','none');
daspect([1 1 1])
view(3); axis tight
camlight
lighting gouraud
If this also returns an empty figure, there may be a graphical issue, e.g. with OPENGL. Please research on those issues then.
If this does return a reasonable figure, indeed the data seems to have an impact. I tried a simple example myself and cannot see small data being problematic (and would not consider your data minimum as small at all). I also looked whether there are exiting known issues. If you like to verify your theory, you can multiple all data points by 1000 and see what happens

Jessica
Jessica 2011 年 2 月 16 日
The example plots just fine. Perhaps my data is too scattered. I will look into that.

cr
cr 2018 年 10 月 5 日
I just noticed that there is a glitch in implementation, essentially inside a helper function. If the data (the last input variable) has more than 20000 values and if it contains repeating or periodic values (or if it is sparse) a helper function isovalue() called by isosurface() extracts a small sample of 20000 values from data to compute histogram. If unfortunately all the data in sample falls into only one bin (which is very likely in aforementioned special cases of data) then the isosurface comes out empty. It so happens that isovalue discards this sole nonempty bin and chooses the next largest bin which will be empty. I'm not sure if I totally understand the logic here but this is what is happening with my data when I use a grid size of 100. Both for 99 and 101 grid sizes give nice plots, but 100 draws a blank. This is one workaround, or the other is to edit this behaviour of isovalue.m -make a copy of isovalue.m to your current folder and comment out the lines shown below. This would force histogram on entire data (which can take a bit of time if data is too large).
if len > 20000
r = floor(len/10000);
end
isovalue.m is found in
\toolbox\matlab\specgraph\private\

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by