필터 지우기
필터 지우기

How to add line style after color

조회 수: 2 (최근 30일)
Asir Tushar
Asir Tushar 2020년 1월 9일
답변: Star Strider 2020년 1월 9일
If I give the colors using [0 0.4470 0.7410] , then how to give the line circle or square shapes ??
I know that plot(x,y,'r+') is used to give the color and style.

채택된 답변

Star Strider
Star Strider 2020년 1월 9일
Try this:
figure
hl = plot((0:9), rand(1,10));
hl.Color = [0 0.4470 0.7410]; % Define Line Color
hl.LineStyle = '-'; % Define Line Style
hl.Marker = 's'; % Define ‘square’ Marker
hl.MarkerFaceColor = 'g'; % Define ‘square’ Marker Color
Use the structure syntax to change the line and marker parameters after the line is plotted.

추가 답변 (1개)

Mateus Banroc
Mateus Banroc 2020년 1월 9일
Hi Asir,
For circle shapes, use 'o'
For square shapes, use 's'.
Check this page about plot properties
https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.line-properties.html

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by