change the color of curve from blue to any color and make it bold
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Aquatris
2024-6-12
x= 0:0.01:2*pi;
y = sin(x);
plot(x,y,'r') % r stands for red look at the documentation for different colors
更多回答(1 个)
Image Analyst
2024-6-12
You can specify the color as a 3 element vector with values between 0 and 1, or use one of the built in colors like 'r':
y = rand(1, 8)+5; % Sample data
darkGreen = [0.1, 0.5, 0.2]; % Define your custom color.
plot(y, 'Color', darkGreen, 'LineWidth', 4); % Plot using numerical vector
hold on;
plot(1:8, 'm-', 'LineWidth', 4); % Plot using built-in color code.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surfaces, Volumes, and Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!