Pete
unread,Dec 9, 2011, 7:23:08 AM12/9/11You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I just found myself needing to do this. In case it is of use to anybody, I neded up doing the following (Mac OS, Matlab R2010a):
1. First I tried:
set(gca,'xcolor',[1 1 1]);
This is great, except it caused the xlabel to also be changed to white when I resized or save the figure
2. Next I tried
set(gca,'xcolor',[1 1 1]);
set(get(gca,'xlabel'),'Color',[0 0 0]); % preserve colour on xlabel
set(figHandle,'ResizeFcn',@(src,event)set(get(gca,'xlabel'),'Color',[0 0 0])); % prevent reset on resize
This sorted out the resize problem, but still when I saved to .eps (using -despc2) the xlabel colour would be reset to the axis colour
3. Finally then, I ended up just drawing a white line over the x-axis, thus:
P = get(gca,'Position');
hLine = annotation('line',[P(1) P(1)+P(3)],[P(4) P(4)],'Color',[1 1 1],'LineWidth',3); % draw a white line over the x axis
% nudge the line so that it covers the axis
set(hLine,'Units','Pixels')
set(hLine,'Position',get(hLine,'Position')+[1 1.5 0 0]) % nudge values might need to be tweaked
set(hLine,'Units',get(gca,'Units'))
This is an ungainly hack, but did the job for me.