![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/290509/image.png)
how can i modify the color of specifc vector and add a label in quiver3
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Andrea Gusmara
le 5 Mai 2020
Modifié(e) : Andrea Gusmara
le 5 Mai 2020
Hi to everyone, i wolud like to understand if I can change the color of quiver3 arrows and add a label.
q_w=quiver3(zeros(3,1),zeros(3,1),zeros(3,1),vec1,vec2,vec3);
q_w.LineWidth=3;
q_w.AutoScaleFactor=8;
% x-y-z Red-Green-Blue
0 commentaires
Réponse acceptée
Image Analyst
le 5 Mai 2020
Try this:
vec1 = rand(3,1);
vec2 = rand(3,1);
vec3 = rand(3,1);
for k = 1 : length(vec1)
q1 =quiver3(0,0,0,vec1(1), vec1(2), vec1(3), 'Color', rand(1,3));
hold on;
q1.LineWidth=3;
q1.AutoScaleFactor=8;
q2 = quiver3(0,0,0,vec2(1), vec2(2), vec2(3), 'Color', rand(1,3));
q2.LineWidth=3;
q2.AutoScaleFactor=8;
q3 = quiver3(0,0,0,vec3(1), vec3(2), vec3(3), 'Color', rand(1,3));
q3.LineWidth=3;
q3.AutoScaleFactor=8;
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/290509/image.png)
Use text() to add a label.
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!