How to add transparency to a dendrogram

조회 수: 1 (최근 30일)
Rafael Freire
Rafael Freire 2020년 1월 17일
편집: Adam Danz 2020년 1월 18일
Hi. How to add a tranparency to a dendrogram?
% example
X = rand(10,3);
tree = linkage(X,'average');
dendrogram(tree)
Thank you
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 17일
Can you elaborate more (which section-transparency)?
Rafael Freire
Rafael Freire 2020년 1월 17일
Hi.
In all plot.

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

답변 (1개)

Adam Danz
Adam Danz 2020년 1월 17일
편집: Adam Danz 2020년 1월 18일
Set up the dendrogram and store the line object handles from the first output of dendrogram().
% Set up the dendrogram
X = rand(10,3);
tree = linkage(X,'average');
denHand = dendrogram(tree) % Get the line handles output
Set the transparency to 50% (or any other value between 0 and 1) by adding a 4th value to the RGB color vector using the color of the first line object as a base. This is an undocumented feature in Matlab.
% Set transparency of dendrogram lines
set(denHand, 'Color', [denHand(1).Color, 0.5])
To set transparency of the axes (is that what you want to do?),
set(gca, 'color', 'none') % completely transparent
set(gca, 'Color', [1 1 1 .5]) % same undocumented method listed above

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by