Plotting filled markers with colors

조회 수: 7 (최근 30일)
bertie
bertie 2014년 6월 4일
댓글: bertie 2014년 6월 4일
Here is a simple snippet of code: %----------------------------------
b=bone; % for the 'bone' colormap
for m=1:64; plot(m*(1:5),'o','MarkerFaceColor',b(m,:)); hold on; end %-----------------------------------
I expected to see a gradient in the color of the markers from black to white, the two extremes in the 'bone' colormap. Instead, I see the colors range from deep blue to a lighter shade of blue. What am I doing wrong?
I have tried this with other colormaps (jet, etc.) as well but the output of the code never shows a color range varying between the extremes of the chosen colormap.
Thanks.

채택된 답변

José-Luis
José-Luis 2014년 6월 4일
  댓글 수: 1
José-Luis
José-Luis 2014년 6월 4일
편집: José-Luis 2014년 6월 4일
b=bone(64); % for the 'bone' colormap
for m=1:64;
plot(m,'o','MarkerFaceColor',b(m,:),'MarkerEdgeColor',b(m,:));
hold on;
end

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

추가 답변 (1개)

bertie
bertie 2014년 6월 4일
I am afraid that didn't do it.
  댓글 수: 2
José-Luis
José-Luis 2014년 6월 4일
That's because the edges were obscuring your figure. Please see revised answer.
Please accept an answer if it helped you.
bertie
bertie 2014년 6월 4일
Thanks! I knew I was doing something silly:)

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by