![](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
6 views (last 30 days)
Show older comments
Andrea Gusmara
on 5 May 2020
Edited: Andrea Gusmara
on 5 May 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 Comments
Accepted Answer
Image Analyst
on 5 May 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.
More Answers (0)
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!