I'm having trouble with the subplot function. I'm working with this code:
filename = 'UnemploymentVacancySeason.xlsx';num = xlsread(filename);subplot(1,2,1);t1=datetime(2000,12,01);t2=datetime(2015,05,01);vr=num(:, 3);ur=num(:, 4);nn=t1+calmonths(0:173);figure;plot(nn, vr, 'r', nn,ur,'b'); xlim ([t1 t2]); datetick('x',12,'keeplimits');subplot(1,2,2);urbefore=num(1:80, 4);vrbefore=num(1:80, 3);figure;plot(urbefore, vrbefore, '-o'); xlim ([3 11]); ylim ([1 4])hold on urafter=num(81:174, 4); vrafter=num(81:174, 3); plot(urafter, vrafter, '-o');hold off
If I remove the subplots from the code but keep the rest as is, I get these:
But if I keep the subplots in the code, then I get three separate figures that look like this:
How can I fix my code so that I can get the first two graphs side by side?
Best Answer