Challenge - Change my avatar colors
4 views (last 30 days)
Show older comments
The spy function without arguments does my avatar picture, white background and blue "spy".
- Change the background color
- Change the color of the "spy"
Tell me the code to perform the two tasks?
Please don't post the code if you appear on the first page of the Contributors or you are well known in the community for your MATLAB skills.
The prize is 4 reputation points, first answer that satisfy the requirements wins, next ones win 1 reputation point if they do the same but in some other way.
PS: The code is very simple, just two small lines.
The Challenge is complete, congratulations to the winner Nathan Greco and to Ian Wood for trying.
My code is this:
spy %draw the spy
set(gca,'Color',[1 0 0]) %change the background color
set(get(gca,'children'),'color',[1 1 0]) %change the "spy" color
4 Comments
Accepted Answer
Nathan Greco
on 1 Jul 2011
My "spy" command gives me a picture of a dog:
spy
To change the background and outline color in one shot:
whitebg
To change just the background:
set(gca,'color','black');
To change just the outline:
set(get(gca,'children'),'markeredgecolor','yellow');
5 Comments
Matt Fig
on 1 Jul 2011
Nathan, thanks for teaching this "old MATLAB dog" a new trick! I hadn't heard of WHITEBG before today.
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!