필터 지우기
필터 지우기

Why is the patch function modifying the line width of existing lines?

조회 수: 5 (최근 30일)
Ana
Ana 2015년 6월 9일
댓글: Tong Zhao 2022년 7월 29일
Hello all, I am having some trouble with the patch function, whenever I use it it is changing the line width (at least apparently) of already existing lines. Here is a code example:
t=0:0.01:4
figure
plot(t,t.^2)
hold on
plot([1,1],[0,16],'--r','LineWidth',2)
plot([2,2],[0,16],'--r','LineWidth',2)
plot([3,3],[0,16],'--r','LineWidth',2)
patch([1,1,2,2],[0,16,16,0],'b','FaceAlpha',0.1,'LineStyle','none')
Before the patch command, the lines have a specific width, but after it they change! Has someone faced this problem before? Is there any solucion to it?
Thank you very much in advance,
Ana

채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 9일
When you add the patch() the renderer changes to OpenGL, as only OpenGL can handle transparency (FaceAlpha).
  댓글 수: 6

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by