필터 지우기
필터 지우기

scatter plot color setting.

조회 수: 2 (최근 30일)
Matt
Matt 2014년 9월 19일
편집: per isakson 2014년 9월 20일
In the matlab code below, I have scattered points. How can i choose different scatterd fonts like * and + and set the color of theses scattered points.
x=[0.8,1.3,2.2,2.9,3.6];
y1=[17.22,18.9,19.74756674,21.64790459,22.77216041];
y2=[0.07,0.11,0.163,0.27,0.29];
[ax, h1, h2] = plotyy(x,y1,Ax,y2,'scatter');
line(x,y1,'Parent',ax(1))
line(x,y2,'Parent',ax(2) )
set(ax(1),'ycolor','r')
set(ax(2),'ycolor','b')
Thank you very much!
  댓글 수: 1
per isakson
per isakson 2014년 9월 19일
The "A" in Ax is that a typo?

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

답변 (1개)

per isakson
per isakson 2014년 9월 19일
Those simple circles are patch objects. (There is a lot to read about patches in the documentation.)
Try
ch1 = get( h1, 'children' )
set( ch1, 'MarkerEdgeColor', [1,0,0] )
  댓글 수: 2
Matt
Matt 2014년 9월 19일
I didnt understand your answer.
per isakson
per isakson 2014년 9월 19일
편집: per isakson 2014년 9월 20일
Execute these two lines after your script. One series of circles will turn red. That is an answer to "set the color of theses scattered points.".
Secondly, I invited you to search the documentation on patch and find out how to change the shape of the "markers".

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

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by