Hi everyone,
I have created several plots into a single figure, but the problem is that the x-axis (dates) are not consistent with my data, so there are gaps between the beginning of the a-axis and the graphs' line and the end of graphs' line and the end of the x-axis. I applied the following code:
% I want to create the x-axis, that is the dates (432x1), ie. starting from 1979:01 to 2014:12
DateNumber = datenum(1979,1:432,1);formatOut='mmmm-dd-yyyy';date = datestr(DateNumber,formatOut);% then I want to print the information in every y(:,i) into a graph by including the dates I created before.
% If y is a matrix 432x27, from 1979:01 to 2014:12, I just want to create the graph with this information
y = randn(432,27);figure()xlength = 0.30;ylength = 0.10;xstart = [0.05 0.39 0.73];ystart = [0.02 0.13 0.24 0.35 0.46 0.57 0.68 0.79 0.90];hold onfor iy=1:9 for ix = 1:3 ind = ix + 3*(iy-1); coordinates = [xstart(ix) ystart(9-iy+1) xlength ylength]; subplot('Position',coordinates); plot(DateNumber,ind*y(:,ind)) drawnow datetick('x','mmm-yy','keepticks') endend
I would appreciate any help.Thanks in advance!
Best Answer