Plotting filled markers with colors

6 Ansichten (letzte 30 Tage)
bertie
bertie am 4 Jun. 2014
Kommentiert: bertie am 4 Jun. 2014
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.

Akzeptierte Antwort

José-Luis
José-Luis am 4 Jun. 2014
b = bone(64);
  1 Kommentar
José-Luis
José-Luis am 4 Jun. 2014
Bearbeitet: José-Luis am 4 Jun. 2014
b=bone(64); % for the 'bone' colormap
for m=1:64;
plot(m,'o','MarkerFaceColor',b(m,:),'MarkerEdgeColor',b(m,:));
hold on;
end

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by