Azzera filtri
Azzera filtri

how to change the transparency of individual colors in the colormap of an image?

12 visualizzazioni (ultimi 30 giorni)
Hello,
I'm using bubblechart to display my data as shown below;
bubblechart(x2xz,z2xz,ones(size(x2xz)),n2xz,'MarkerFaceAlpha',0.1,'MarkerEdgeAlpha',0.2);
-this works. However it would be better if I could make MarkerFaceAlpha a variable, so that it changes based on the value of n2xz (which currently controls the colour of the bubbles). Unfortunately MarkerFaceAlpha has to be a scalar, not a vector, with bubblechart.
The plot command accepts colours in this format (where the fourth column is the transparency); 'Color',[0.0 0.0 1.0 0.3], but when I build a colormap with four columns and try to use that instead of using the MarkerFaceAlpha option, the colormap command rejects it.
I have googled this and searched Matlab Answers, but nothing useful was found.
Any suggestions would be gratefully received. Thank you.
Gordon Cooper

Risposte (1)

DGM
DGM il 18 Mag 2024
Modificato: DGM il 18 Mag 2024
I don't have a new enough version to use bubblechart() or dig into its properties, but the behavior of plot() with RGBA tuples is undocumented, so don't extrapolate too far about what might be supported.
I don't know of anything which accepts a Mx4 RGBA color table. The few places I remember finding RGBA tuples in hidden properties, they weren't consistently unit-scale floats. You might be able to dig into hidden properties to make undocumented things work, but they might not.
Maybe someone has more insight into the newer stuff though.

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by