Challenge - Change my avatar colors
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Nathan Greco
2011 年 7 月 1 日
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 件のコメント
Matt Fig
2011 年 7 月 1 日
Nathan, thanks for teaching this "old MATLAB dog" a new trick! I hadn't heard of WHITEBG before today.
参考
カテゴリ
Help Center および File Exchange で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!