필터 지우기
필터 지우기

Plot style '--' in 2014b

조회 수: 5 (최근 30일)
Stephen Politzer-Ahles
Stephen Politzer-Ahles 2015년 1월 14일
답변: Spase 2016년 6월 5일
Plot styles like '--' and ':' are no longer working properly for me after I upgraded to 2014b. Specifically, if I plot a vector that has lots of elements, then it still shows up as a solid line even if I specify a different style. For example, this code yields the image following for me, where in the lower subplot you can see that the line looks like a solid line even though it is supposed to be dashed:
figure; hold on;
vectorlengths = [50 500];
titles = {'short vector' 'long vector'};
for i=1:2
x = linspace(0, 2*pi, vectorlengths(i));
y1 = sin(x);
y2 = cos(x);
subplot(2,1,i); plot(x, [y1;y2], '--', 'LineWidth', 2); title( titles(i) );
end;
It's not quite as simple as that---this problem also is affected by the slope of the line, so for more complicated squiggly lines the style actually changes at different points along the curve, as you can especially see from the green line in the center subplot of this figure and the red line in the left subplot:
What is causing this behavior, and how can I properly control the line styles? What I would like is a dashed line that stays dashed (which is the behavior I got in 2014a and earlier).
Thanks, Steve
  댓글 수: 3
Stephen Politzer-Ahles
Stephen Politzer-Ahles 2015년 1월 14일
Adam: thanks, I just tried switching to hardware opengl (opengl info indicated that I was using software opengl) and this seems to have fixed it (so far).
Best, Steve
Adam
Adam 2015년 1월 14일
That is good then. I will add that as an answer then in case other people come to this thread looking for a solution and don't look at all the comments.

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

채택된 답변

Adam
Adam 2015년 1월 14일
Try switching to use hardware opengl using:
opengl( 'hardware' )
(More details in my comment to the original question).
  댓글 수: 1
David Young
David Young 2015년 1월 14일
Odd that hardware is OK but software not. It was the other way round for the problem I experienced!

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

추가 답변 (2개)

David Young
David Young 2015년 1월 14일
I think you should contact MathWorks about this. I've also experienced significant problems with plot() in R2014b (in my case with the '.' style), which they said they were aware of.

Spase
Spase 2016년 6월 5일
I have Matlab 2015b on Mac, and opengl( 'hardware' ) didn't make any difference.. I still experience the same problem as Steve. Moreover, seems like in Mac 'hardware' is the only option for OpenGL. Spase

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by