Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Sia

Posts: 9
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'));
end

But I dislike it. any solution?
thanks.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.