This code
1 function makegraph(A,B)
2 results=load(A);
3 time = results(:,3) - 1238370000;
4 firstTimeIndex = find(time >= (max(time) - 86400*7), 1);
5 results = results(max(1,firstTimeIndex-1):end, :);%Results now only containe s data from the last week
6 temp = results(:,3)-1238370000;
7 h=plot(temp,smooth(results(:,1)),':b','linewidth',2)
8 ylim([0 80])
9 xlim([max(temp)-(86400*7),max(temp)-1])
10 set(gca,'color','black')
11 set(gcf,'color','black') %get's rid of he axis alltogether
12 hold on
13 plot(temp, smooth(results(:,4)), 'r', 'linewidth', 2);
14 plot(temp, smooth(results(:,5)), 'g', 'linewidth', 2);
15 plot(temp, smooth(results(:,6)), 'm', 'linewidth', 2);
16 xlim([max(temp)-(86400*7),max(temp)-1])
17 set(gca,'XTick',[1:86400:(max(temp))+1])
18 set(gca,'XTickLabel',['Mon';'Tue';'Wed';'Thu';'Fri';'Sat';'Sun'])
19 print('-djpeg',B)
20 hold off
Saves this graph in the filename 'B'...
It works fine, but I'd like to put it in a different context, for which I need it to have a black background...
I have tried setting
set(gca,'color',[1 1 0])
set(gcf,'color',[1 1 0])
as described by Setting the background color of a plot in MATLAB using the command line?
and I've tried
whitebg(1,'k')
...and I'm getting nowhere -particualarly because sometimes when I try and play around with some of
set(gca,'color','black') set(gcf,'color','black') settings, some of my plots disappear.
I'm deeply confused.. could someone tell me why the accepted answer at Setting the background color of a plot in MATLAB using the command line? isn't working here...?