Plot a circular histogram for table Data
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Gavin Seddon
il 31 Mag 2022
Commentato: Star Strider
il 31 Mag 2022
Hello
I have a table of angles v deviations
how do I plot a circhist of the table?
G.
0 Commenti
Risposta accettata
Star Strider
il 31 Mag 2022
I am not certain what the data are, how how the angles and deviations relate. Perhaps either polarplot or polarhistogram will do what you want.
ang = linspace(0, 2*pi, 50);
dev = rand(size(ang));
r = 1;
th = linspace(0, 2*pi, 180);
xc = r*cos(th);
yc = r*sin(th);
rx = xc(1:15:end);
ry = yc(1:15:end);
[xs,ys] = stairs(ang,dev);
xs = [xs; xs(1:2)];
ys = [ys; ys(1:2)];
[xp,yp] = pol2cart(xs,ys);
figure
plot(xp, yp)
hold on
plot(xc, yc, '-k')
zv = zeros(size(rx));
plot([zv;rx], [zv;ry], '--k')
hold off
axis('equal')
Ax = gca;
Ax.XColor = 'none';
Ax.YColor = 'none';
.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!