The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Auto MarkerFaceColor
Replies: 2   Last Post: Feb 22, 2013 6:32 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 14
Registered: 11/30/12
Auto MarkerFaceColor
Posted: Feb 19, 2013 10:36 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello everyone.

I plot with multi lines like this:

plot([0 1],[0 1; 0 2;0 3; 0 4],'o-');
matlab automatically chose the color for each line.
I want to fill the markers with the same color as the lines. I try to use this:

plot([0 1],[0 1; 0 2;0 3; 0 4],'o-','MarkerFaceColor','auto');

but it dosn't work and the markers filled with white color. Is any body knows how can I overcome this?
of course there is a solution that I wrote a for loop and plot a line in each loop and got the color on lines and fill it within the loop:

for a = 1:4
h = plot([0 1],[0 a],'o-');
set(h, 'MarkerFaceColor', get(h, 'Color'));

But I dislike it. any solution?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.