Hi, Is there any way to make the dots that appear in a plot transparent? an example of what i would like to do is
plot(x,y, 'color', [1 0 0], 'alpha', 0.5)

 채택된 답변

Matt Fig
Matt Fig 2011년 4월 22일

3 개 추천

Not with a line object, but you can use an old graphics 'trick' to get it done:
% Your data...
x = 1:10;
y = x.^2;
% Now make the 'line' (actually a surface)...
z = zeros(size(x));
S = surface([x;x],[y;y],[z;z],...
'facecol','no',...
'edgecol','interp',...
'linew',2,...
'edgealpha',.2,...
'edgecolor','b');

댓글 수: 3

Ian
Ian 2011년 4월 22일
Thanks for the information.
I did not specify that I am plotting 'dots'. But I also found this solution.
for i =1:len
p=patch([X(i) X(i) X(i)-width X(i)-width],[Y(i) Y(i)+height Y(i)+height Y(i)], color(s,:));
set(p,'FaceAlpha',0.125, 'EdgeColor', 'none');
end
Jeffrey Girard
Jeffrey Girard 2014년 10월 23일
This worked well for me Ian, thank you. However, I was hoping to plot the dots as circles rather than rectangles. Do you have a trick on how to do so?
José-Luis
José-Luis 2014년 10월 23일
This is a 3-years old thread. Please ask a new question.

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

추가 답변 (0개)

카테고리

질문:

Ian
2011년 4월 22일

댓글:

2014년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by