删除切片中的小值 [英] Removing small values in slice
问题描述
如何删除切片图中的小值?在我的情节中,基本上蓝色太多,我看不到里面的红点.
How can I delete the small values in a slice plot? In my plot, there is basically too much blue and I cannot see the red points inside.
或者,稍微不同:
*是否可以用 matlab 删除切片图中的一些点?
*Is it possible delete some points in a slice plot with matlab?
slice(X,Y,Z,V,sx,sy,sz) 表示由 sx,sy 和 sz 定义的整个平面上体积 V 的值.但是我可以选择只保留这些计划中的一些点吗?
slice(X,Y,Z,V,sx,sy,sz) represents the value of the volume V on the whole plans defined by sx,sy and sz. But can I choose to keep some points of these plans only?
我们是否必须在整个计划中表示 V 的值?
Do we have to represent the values of V on the whole plan?
我可以让小价值"透明吗?
Can I make "small values" transparent?
编辑新代码:
h =slice(x,y,z,V,sx,sy,sz);
for n=1:length(h)
set(h(n), 'alphadata',get(h(n),'cdata'), 'facealpha','flat');
end
a = alphamap('rampup',256);
a(a<(threshold)) = 0;
a(a>(threshold)) = 0.07;
alphamap(a);
我尝试了上面的代码.然而,这是我得到的情节:我认为 cdata(颜色)有问题,但我不知道这是什么...
I tried with the code above. However, this is the plot I am getting: I think there is a problem with cdata (the colors) but I can't figure out what this is...
推荐答案
您可以调整透明度,使较低的值更加透明.首先,您需要切片的句柄:
You can adjust the transparency so lower values are more transparent. First, you need the handles to your slices:
h = slice(X,Y,Z,V,sx,sy,sz);
h
不是单个句柄,而是不同切片的一系列句柄.对于任何一个手柄,您都可以更改透明度(或循环所有 n 以更改它们):
h
is not a single handle but a series of handles to the different slices. For any one handle you can change the transparency (or loop around for all n to change them all):
set(h(n),'alphadata',get(h(n),'cdata'),'facealpha','flat')
;
alphadata
是透明度的数据 - 默认情况下这是1"(不透明),因此对于每个句柄,您可以将其设置为 cdata
的内容.AlphaDataMapping
应该已经默认设置为 scaled
- 所以 alphadata
中的值被映射到一个 alphamap,就像 cdata
值映射到您的颜色图(稍后会详细介绍).
alphadata
is the data for transparency - by default this is "1" (opaque), so instead for each handle you can set it to the contents of cdata
. AlphaDataMapping
should already be set to scaled
by default - so the values in alphadata
are mapped to an alphamap, just as cdata
values are mapped to your colormap (more on that later).
facealpha
是如何将 alphadata 应用于对象面部的设置 - 需要更改以便实际使用 alphadata 中的值.
facealpha
is a setting for how the alphadata is applied to the faces of an object - needs to be changed so that the values in alphadata are actually used.
如果您想调整透明值的透明度或透明值,您可以更改 alphamap.默认地图只是线性的,可以通过 plot(get(gcf,'Alphamap'))
看到,其中 0 = 不可见,1 = 不透明.地图的长度可能会有所不同,因此您有很大的调整自由度 - 例如,如果您对这些值不感兴趣,您可以将下部完全归零:
If you want to adjust how transparent values are or which are transparent, you can change the alphamap. The default map is just linear and can be seen by plot(get(gcf,'Alphamap'))
, where is 0 = invisible and 1 = opaque. The length of the map can vary so you have a lot of freedom in adjusting it - for example you can completely zero out the lower part if you're not interested in those values:
a = alphamap('rampup',256);
a(1:80)=0;
alphamap(a); % only changes alphamap of current figure
在 此处.
这篇关于删除切片中的小值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!