% clear all variables clear all; % close all open plots close all; % clear the command window clc; % plot simple ERP waveforms % by Olave E. Krigolson % note, data is assumed to be time x conditions for a single channel, in % this case a 200 x 2 matrix erpLineWdith = 3; labelFontSize = 24; tickLabelFontSize = 20; % load the plot data load('plotData.mat'); % create a time vector for the plot timeVector = [-200:4:596]; % uncomment this to specifcy a specific print size, say 9 x 6 cm for % printing %fig = makefigure(9,6); % plot the first condition plot(timeVector,plotData(:,1),'LineWidth',erpLineWdith); % keep the plot on to draw the second line on top hold on; % plot the second condition plot(timeVector,plotData(:,2),'LineWidth',erpLineWdith); % turn off the plotting hold hold off; % fancy up the graph a bit % get the axis handle axisHandle = gca; % assign a font size axisHandle.FontSize = tickLabelFontSize; % remove the ticks axisHandle.TickLength = [0 0]; % set the background colour to white set(gcf,'color','white'); % turn off the border "box" box off; % set the x-axis label color to black axisHandle.XAxis.Label.Color = [0 0 0]; % keep the labels on by making their colour balck axisHandle.XAxis.Label.Visible = 'on'; % label some stuff title('Win versus Loss Grand Average ERP Waveforms','fontsize',labelFontSize); xlabel('Time (ms)','fontsize',labelFontSize); ylabel('Voltage (uV)','fontsize',labelFontSize); % add a line through 0 on the y-axis line([-200 596],[0 0],'Color',[0 0 0],'LineWidth',1); % remove white space from around figure body, note these values are % specific to your display leftSpace = 0.04; bottomSpace = 0.06; rightSpace = 0.93; topSpace = 0.9; axisHandle.Position = [leftSpace bottomSpace rightSpace topSpace]; % save the file at a manuscript resolution, use '-dtiffn' for tiff % manuscript plots, '-djpeg' for jpeg % uncomment this to print the figure to a file % print('simpleERPPlot','-djpeg','-r600');