Plot doubt: how to fill the squares.

조회 수: 23 (최근 30일)
Andoni Mendialdua
Andoni Mendialdua 2014년 8월 19일
댓글: Andoni Mendialdua 2014년 8월 20일
Hello, I am using plot function to plot some data at the same time:
plot(AATnew,QG,'s',AATnew,Y,'-')
The problem I have is that the squares I have in the plot are empty and I can not fill them with any colour. How could I solve the problem?
Thank you,
Andoni

채택된 답변

Evan
Evan 2014년 8월 19일
편집: Evan 2014년 8월 19일
Try using the MarkerFaceColor property.
Example:
x = 0:pi/32:2*pi;
y = sin(x);
z = cos(x);
plot(x,y,'s',x,z,'-','MarkerFaceColor',[0 0 0])
That seems to work fine, since your second set of data is plotted with a line marker, but you could always also split them up into separate plot commands if you for some reason wanted to control the marker face color of each.
  댓글 수: 3
Evan
Evan 2014년 8월 19일
Does the example I added help, or are you still having problems?
Andoni Mendialdua
Andoni Mendialdua 2014년 8월 20일
Thank you very much Evan. I solved the problem:)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by