How to change the linewidth of a curve in a graph by using code?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
bainhome
el 7 de Oct. de 2016
Comentada: bainhome
el 7 de Oct. de 2016
like:
x=linspace(0,2*pi);
y=sin(x)
I want the sine curve's linewidth is 2.
0 comentarios
Respuesta aceptada
uu tsi
el 7 de Oct. de 2016
use linewidth
x=linspace(0,2*pi);
y=sin(x);
plot(x, y, 'linewidth',2)
0 comentarios
Más respuestas (1)
Adam
el 7 de Oct. de 2016
Editada: Adam
el 7 de Oct. de 2016
Well, you haven't plotted anything with that code, but assuming you do:
hLine = plot( x, y );
hLine.LineWidth = 2; % Matlab R2014b or later
set( hLine, 'LineWidth', 2 ) % Matlab R2014a or earlier
or simply
hLine = plot( x, y, 'LineWidth', 2 );
all at once
Ver también
Categorías
Más información sobre Specifying Target for Graphics Output 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!