EE1021 Programming for Engineers - Lecture 13
PlottingData.mat file:
plot(x,y) syntax.PlotEEG was a single vector (one line).') to transpose.ErrorbarSE.scatter function.plot commands overwrite the previously displayed figure by default.close:hold on.plot(PlotEEGTime, PlotEEG) % Plot first line
hold on % 'Hold' the figure
plot(PlotEEGTime, PlotEEG2) % Plot second line
hold off % Stop 'holding'xlim([min max]) and ylim([min max]).axis tight: Sets limits to exactly match data range.axis square: Makes plot window square.axis off: Removes axes, labels, and background.xlabel and ylabel.title('Title', 'FontSize', 24)
title('Title', 'FontSize', 24, 'FontName', 'Courier')
title('Title', 'FontSize', 24, 'FontWeight', 'bold')
title('Title', 'FontSize', 24, 'FontAngle', 'italic')listfonts to see available fonts.LineWidth, Color, LineStyle.hold on to mix styles:[R G B] (0-1 values).'r--*' (red, dashed, star marker).set and get functionsset(handle, property, value)get(handle, property)gca: Shortcut for “Get Current Axis”.subplot(rows, cols, index)subplot to variables (h1, h2…).bar(Y) or bar(X, Y).hist(data): Default 10 bins.contourf(Z) or contourf(X, Y, Z).imagesc reverses the Y-axis by default (image coordinates).figure
imagesc(MorletTime, MorletFreq, Morlet)
xlabel('Time', 'FontSize', 14)
ylabel('Freq', 'FontSize', 14)