필터 지우기
필터 지우기

Change the transparency/alpha of data brushing

조회 수: 3 (최근 30일)
Scott Smith
Scott Smith 2023년 5월 31일
답변: Nithin Kumar 2023년 6월 6일
Simple question, I'd like to change the transparency/alpha of the red brushed data points.
Is there any way to do this?
I know you can change the color, to blue like this
b = brush;
b.Color = [0 0 1]
And to get the brushed data (after brushing, in a callback)
get(b,'BrushedData') %hidden property...
But I'd like to change the transparency that matlab uses when brushing data, specifically a brushed scatter plot

답변 (1개)

Nithin Kumar
Nithin Kumar 2023년 6월 6일
Hi Scott,
To change the transparency of a brushed scatter plot, kindly refer to the following example.
x = rand(100,1);
y = rand(100,1);
scatter(x,y)
brush on
brushedDataHandle = findobj(gcf, 'Tag', 'brushed'); % findobj function is used here to get the handle to the brushed data points
set(brushedDataHandle, 'MarkerFaceAlpha', 0.5);
drawnow
For more information regarding “MarkerFaceAlpha” property, refer to the following documentation.
I hope this answer helps you.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by