- Try semilogy
- Try legend
How can I make multiple lines on a graph more spaced apart?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have to put 4 lines on the same graph but they overlap and are hard to see clearly. Is there anyway to make them more spaced out or stretch the axes so that they can be seen better?
figure
errorbar(K20conc,K20int1,K20errx,K20erry,'rx','MarkerSize',5,'CapSize',12,...
'Linestyle','none', 'HandleVisibility','off') ;
hold on
K20line = polyfit(K20conc, K20int1,1);
K20fit = polyval(K20line,K20conc);
plot(K20conc,K20fit,'k-','DisplayName','2020 - K 766.491')
hold on
errorbar(K20conc,K20int2,K20errx,K20erry2,'kx','MarkerSize',5,'CapSize',12,...
'Linestyle','none', 'HandleVisibility','off') ;
hold on
K20line2 = polyfit(K20conc, K20int2,1);
K20fit2 = polyval(K20line2,K20conc);
plot(K20conc,K20fit2,'g-','DisplayName','2020 - K 769.897')
errorbar(K21conc,K21int1,K21errx,K21erry,'gx','MarkerSize',5,'CapSize',12,...
'Linestyle','none', 'HandleVisibility','off') ;
hold on
K21line = polyfit(K21conc, K21int1,1);
K21fit = polyval(K21line,K21conc);
plot(K21conc,K21fit,'b-','DisplayName','2021 - K 766.491')
hold on
errorbar(K21conc,K21int2,K21errx,K21erry2,'bx','MarkerSize',5,'CapSize',12,...
'Linestyle','none', 'HandleVisibility','off') ;
hold on
K21line2 = polyfit(K21conc, K21int2,1);
K21fit2 = polyval(K21line2,K21conc);
plot(K21conc,K21fit2,'c-','DisplayName','2021 - K 769.897')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/707442/image.png)
0 comentarios
Respuestas (1)
darova
el 11 de Ag. de 2021
t = 0:0.1:10;
plot(t,sin(t),'.r')
line(t,sin(t))
line(t,cos(t),'marker','.','color','g')
line(t,cos(t),'color', 'm')
legend('curve1','curvw2', 'curve3','curve4')
Ver también
Categorías
Más información sobre Legend en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!