필터 지우기
필터 지우기

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

조회 수: 12 (최근 30일)
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

답변 (1개)

DGM
DGM 2024년 5월 18일
편집: DGM 2024년 5월 18일
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.

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by