Plotting filled markers with colors

7 次查看(过去 30 天)
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