From: theiman on 20 Jan 2010 04:51 Hi, When I use the following code with the set(gca etc..) and datetick lines commented out it produces a graph without the correct xlabesl however if I use them all I get is the correct xlabels and ylabels but no graph..ANy ideas on what I am doing wrong? Thank you!! Sincerely, tom FAR1=[0.0200 0.0190 0.0210 0.0221 0.0210 0.0225 0.0222 0.0224 0.0220 0.0218 0.0236 0.0329 0.0395 0.0422 0.0411 0.0437 0.0418 0.0432 0.0412 0.0413 0.0378 0.0400 0.0369 0.0405] trainingrange=1:23; month = [1:12 1:12]; day = 1; year = [repmat(2008, 1, 12) repmat(2009, 1, 12)]; xData = datenum(year, month, day); lxData1=length(xData); lxData2=length(trainingrange); beg1=lxData1-13; beg2=lxData2-13; %FAR=inputdata(beg2:lxData2,12); FAR2=FAR1(beg2:lxData2) stdfar=std(FAR2); std3far=3*stdfar; [r,c] = size(FAR2); farstddummy = ones(r,1); farstddummy = farstddummy.*std3far; upperlimit = (sum([FAR2 farstddummy],2)); lowerlimit = (FAR2-farstddummy); bar(FAR2); hold ylabel('FAR %'); xlabel('Month'); %set(gca,'XTick',xData(beg2:lxData2)) %datetick('x','mmmyy','keepticks'); stuff=FAR2; ls=length(stuff) for i=1:ls, text((i),stuff(i),... num2str(stuff(i)),... 'FontSize',12,... 'HorizontalAlignment','center',... 'VerticalAlignment','bottom'); end plot(FAR2,'-r','LineWidth',4) plot(upperlimit,'g','LineWidth',4) plot(lowerlimit,'c','LineWidth',4) legend('FARbox','FAR','3 std UpperLimit','3 std LowerLimit'); Title('FAR % Chart','FontSize',14)
From: Nathan on 20 Jan 2010 15:24 On Jan 20, 11:51 am, theiman <thei...(a)mitre.org> wrote: > Hi, > > When I use the following code with the set(gca etc..) and datetick lines commented out it produces a graph without the correct xlabesl however if I use them all I get is the correct xlabels and ylabels but no graph..ANy ideas on what I am doing wrong? Thank you!! > > Sincerely, > > tom > > FAR1=[0.0200 > 0.0190 > 0.0210 > 0.0221 > 0.0210 > 0.0225 > 0.0222 > 0.0224 > 0.0220 > 0.0218 > 0.0236 > 0.0329 > 0.0395 > 0.0422 > 0.0411 > 0.0437 > 0.0418 > 0.0432 > 0.0412 > 0.0413 > 0.0378 > 0.0400 > 0.0369 > 0.0405] > > trainingrange=1:23; > > month = [1:12 1:12]; > day = 1; > year = [repmat(2008, 1, 12) repmat(2009, 1, 12)]; > xData = datenum(year, month, day); > lxData1=length(xData); > lxData2=length(trainingrange); > beg1=lxData1-13; > beg2=lxData2-13; > %FAR=inputdata(beg2:lxData2,12); > FAR2=FAR1(beg2:lxData2) > stdfar=std(FAR2); > std3far=3*stdfar; > [r,c] = size(FAR2); > farstddummy = ones(r,1); > farstddummy = farstddummy.*std3far; > upperlimit = (sum([FAR2 farstddummy],2)); > lowerlimit = (FAR2-farstddummy); > > bar(FAR2); > hold > ylabel('FAR %'); xlabel('Month'); > %set(gca,'XTick',xData(beg2:lxData2)) > %datetick('x','mmmyy','keepticks'); > stuff=FAR2; > ls=length(stuff) > for i=1:ls, > text((i),stuff(i),... > num2str(stuff(i)),... > 'FontSize',12,... > 'HorizontalAlignment','center',... > 'VerticalAlignment','bottom'); > end > plot(FAR2,'-r','LineWidth',4) > plot(upperlimit,'g','LineWidth',4) > plot(lowerlimit,'c','LineWidth',4) > legend('FARbox','FAR','3 std UpperLimit','3 std LowerLimit'); > Title('FAR % Chart','FontSize',14) replace those two commented lines with: set(gca,'Xticklabel',datestr(xData(beg2:lxData2),12)) %The 12 at the end represents mmmyy format -Nathan
From: theiman on 20 Jan 2010 21:52 Hi Nathan, Thank you!!! That did the trick!!!! SIncerely, tom
|
Pages: 1 Prev: figure sizing issue Next: plotyy: setting ylim for both right & left |