change the color of curve from blue to any color and make it bold

1 vue (au cours des 30 derniers jours)
Ghazi
Ghazi le 12 Juin 2024
Commenté : Ghazi le 12 Juin 2024
  2 commentaires
Ganesh
Ganesh le 12 Juin 2024
Modifié(e) : Ganesh le 12 Juin 2024
Hi @Ghazi,
Since your question is pretty straight forward, I would suggest you to go through the MATLAB Documentation:
Ghazi
Ghazi le 12 Juin 2024
thank you

Connectez-vous pour commenter.

Réponse acceptée

Aquatris
Aquatris le 12 Juin 2024
x= 0:0.01:2*pi;
y = sin(x);
plot(x,y,'r') % r stands for red look at the documentation for different colors

Plus de réponses (1)

Image Analyst
Image Analyst le 12 Juin 2024
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.

Catégories

En savoir plus sur Surfaces, Volumes, and Polygons dans Help Center et File Exchange

Tags

Produits


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by