필터 지우기
필터 지우기

How can I apply variable transparency to a plot using scatter3?

조회 수: 88 (최근 30일)
Steffen Adria
Steffen Adria 2011년 7월 4일
편집: Jacek Wodecki 2024년 7월 11일
I'm producing a 3D model, and interior points happen to be more interesting to me. I have a 4-column matrix representing (x,y,z,intensity), and I'm most interested in the high-intensity points; currently they're coloured by intensity. Can I make it so that the transparency of low-intensity points is increased (but I need them to still be visible)?
Thanks
  댓글 수: 2
Steffen Adria
Steffen Adria 2011년 7월 14일
I have found a solution! I scaled both the colour and *size* of my points so that the outer, less intense points are smaller than the inner, more intense points I want to see, so I can see past the outer layer!
raym
raym 2017년 6월 4일
Great! I also have same problem

댓글을 달려면 로그인하십시오.

채택된 답변

Patrick Kalita
Patrick Kalita 2011년 7월 5일
MATLAB doesn't allow you to control the transparency of markers.
If you don't have a tremendous number of data points you could try drawing small spherical surfaces at each data point. Then you could control the transparency of those surfaces. Here's a File Exchange submission that might help you get started.
  댓글 수: 6
Walter Roberson
Walter Roberson 2017년 6월 4일
In R2014a and earlier, scatter3() uses patches. In R2014b and later, it does not.
In R2014b and later, there is MarkerFaceAlpha property that can be used to set a single transparency for all of the points.
In R2014b and later, to adjust each of the transparencies individually, then if h is the handle returned by calling scatter3(),
N = h.MarkerHandle.FaceColorData;
N(4,:) = new transparency data, expressed as integer values from 0 to 255
h.MarkerHandle.FaceColorData = N;
Jacek Wodecki
Jacek Wodecki 2022년 8월 17일
편집: Jacek Wodecki 2024년 7월 11일
it doesn't work, matlab 2021b
EDIT: still doesn't work until 2024a

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Lockenlui
Lockenlui 2018년 12월 27일
편집: Lockenlui 2018년 12월 27일
You can use
h = scatter3(..)
alpha = 0.5;
set(h, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
in order to set the transparancy for the edge as well as the face of the marker.

bym
bym 2011년 7월 4일
I am not sure I understand the question, perhaps
slice()
would be useful?
  댓글 수: 2
Steffen Adria
Steffen Adria 2011년 7월 4일
I need to see the whole thing at once in 3D. I need to see the exterior most of all, but I'm also trying to see some points that might be lying just inside the surface. It's fuzzy data so some noise is present and I'm not sure where the boundary between empty space and the object is. I'm expecting that an intense core will be present under a thin layer of low-intensity points; I want to be able to see both.
KRUNAL
KRUNAL 2014년 8월 21일
Were you able to find a solution to the above question Steffen. If so, can you please post your code here

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by