Change the transparency/alpha of data brushing

2 vues (au cours des 30 derniers jours)
Scott Smith
Scott Smith le 31 Mai 2023
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

Réponses (1)

Nithin Kumar
Nithin Kumar le 6 Juin 2023
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.

Catégories

En savoir plus sur Graphics Performance dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by