x=[0:0.01:2*pi];

p1h=plot(x,sin(x),'k--',x,sin(x+pi/6),'k:',x,sin(x+pi/3),'k-.','LineWidth',1)

l1h=legend('Dash --','Dotted :','Dash Dot -.')

axis([0 7 -1 1]);

figno=gcf;

set(figno, 'units', 'centimeters', 'pos', [0 0 10 8])

set(figno,'paperunits','centimeters')

set(figno,'paperposition',[0,0,10,8])

fontname ='Times New Roman';

hA=gca;

set(hA,'defaultaxesfontname',fontname);

set(hA,'defaulttextfontname',fontname);

set(hA,'fontname',fontname);

xlabel('This is the xlabel');

ylabel('This is the ylabel');

set(hA,'GridAlpha',0.8);

set(l1h,'Interpreter','Latex','FontSize',9,'FontName','Times New Roman');

set(hA,'FontUnits','points','FontWeight','normal', ...

'FontSize',9,'FontName','Times New Roman');

release=version('-release');

eps_file_output=['deleteme_',release,'.eps'];

print(eps_file_output,'-deps')

## 1 Comment

## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/57632-long-dashes-in-a-dashed-line-matlab-plot#comment_288749

⋮## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/57632-long-dashes-in-a-dashed-line-matlab-plot#comment_288749

Sign in to comment.