Challenge - Change my avatar colors

2 views (last 30 days)
The spy function without arguments does my avatar picture, white background and blue "spy".
  1. Change the background color
  2. 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
Oleg Komarov
Oleg Komarov on 1 Jul 2011
But think about all the broken hopes....MuhsuhAHuahua
Paulo Silva
Paulo Silva on 1 Jul 2011
I edited the question several times in order to avoid cheating and also thought about the fake accounts but it would be too much effort for nothing.

Sign in to comment.

Accepted Answer

Nathan Greco
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
Paulo Silva
Paulo Silva on 1 Jul 2011
I changed the color propertie of the axes children instead of the marker like you did, congratulations for wining this small contest :)
Matt Fig
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.

Sign in to comment.

More Answers (1)

Ian Wood
Ian Wood on 1 Jul 2011
load spy
colormap(hot)
  10 Comments
Paulo Silva
Paulo Silva on 1 Jul 2011
spy
c=get(gca,'children');
x=get(c,'xdata');
y=get(c,'ydata');
cla
plot(x,y,'*')
set(gca,'ydir','reverse')
saveas(gcf,'spy.jpg')
im=imread('spy.jpg');
image(im)
colormap(gca,hot)
Ian was right in the part where the colormap would change the colors of the current figure, sorry about my mistake Ian but I can't make it to work anyway I try :(
Ian Wood
Ian Wood on 2 Jul 2011
That's ok, I was just wondering if I was on the right track. Thanks for the code :)

Sign in to comment.

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!