% Multiple plots using setPlotProp. Sets color, legend, line style, tick % etc. clear all; %addpath('../lib'); data= dlmread('Fig2.txt','',1,0); %% figure; plot(data(:,1),data(:,2),data(:,1),data(:,3),data(:,1),data(:,4),data(:,1),data(:,5), ... data(:,1),data(:,6),data(:,1),data(:,7),data(:,1),data(:,8)); ax = gca; ax.XAxis.TickLabelFormat = '%,.1f'; ax.YAxis.TickLabelFormat = '%,.2f'; %% change properties opt.BoxDim=[4.2,3]; opt.XLabel = '\it{r}/\sigma'; % xlabel opt.YLabel = '\langle\it{U^{tot}_{2}}\rangle\it{/k_{B}T^{exp}}'; %ylabel opt.YTick = [-0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]; %[tick1, tick2, .. ] opt.XLim = [1, 5]; % [min, max] opt.YLim = [-0.75, 1]; % [min, max] opt.XMinorTick='off'; opt.YMinorTick='off'; opt.Colors = [ % set color for data plot 0,0,0; 0.5,0.5,0.5; 1,0,1; 0, 1, 1; 0, 0, 1; 0,1,0; 1,0,0; ]; opt.LineWidth = [1.5, 1.5, 1.5]; % three line widths %opt.LineStyle = {'-', ':', '--'}; % three line styles opt.Legend = {'\theta = 90^o', '\theta = 60^o', '\theta = 54.7^o', ... '\theta = 53^o', '\theta = 52^o', '\theta = 40^o','\theta = 0^o'}; % legends % Save? comment the following line if you do not want to save opt.FileName = 'Figure2.png'; % create the plot setPlotProp(opt);