change width and color of a compass plot

28 vues (au cours des 30 derniers jours)
Ismaeel
Ismaeel le 11 Avr 2019
Modifié(e) : Adam Danz le 11 Avr 2019
I have a compass plot (attached) and I want to cnage the line width, color, and type using code not manually. Any help would be greatly appreciated.
Thanks
untitled.jpg

Réponse acceptée

Ismaeel
Ismaeel le 11 Avr 2019
Thaks Adam, but I use compass function not polarplot.
Anyway, I found my solution in:
using the following code:
Z = compass(eig(randn(5)));
colors = get(0,'DefaultAxesColorOrder')
for i=1:length(Z)
set(Z(i),'color',colors(mod(i-1,length(colors))+1,:),'linewidth',2)
end
Thanks
  1 commentaire
Adam Danz
Adam Danz le 11 Avr 2019
Modifié(e) : Adam Danz le 11 Avr 2019
It doesn't really matter which plotting function you're using (in most cases). The solution is the same as my answer.

Connectez-vous pour commenter.

Plus de réponses (1)

Adam Danz
Adam Danz le 11 Avr 2019
Use the handle output from the plotting function.
Example:
h = polarplot(theta,rho);
h.LineWidth = 3;
h.Color = 'r';

Catégories

En savoir plus sur 2-D and 3-D Plots 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!

Translated by