Matlap plot- linspec features
조회 수: 6 (최근 30일)
이전 댓글 표시
plot(x,y,'-', 'color', cmap(jj,:));
Is there any way I can have matlab plot the data first and the use the linespec '-'?
댓글 수: 0
답변 (1개)
Steven Lord
2018년 7월 30일
So you want to just call:
plot(x, y)
then change the plotted line to have a different line style or color? Call plot with an output, so you have a handle to the line, then change its properties.
x = 0:0.1:2*pi;
y = sin(x);
h = plot(x, y);
pause % So you can see how the plot looks before its properties change
h.Color = 'r';
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!