compass plot

7 visualizzazioni (ultimi 30 giorni)
muhammad tariq
muhammad tariq il 21 Ago 2011
Risposto: Abby Skofield il 7 Ott 2024
Hi,
How do I make Compass Plot to display the zero degrees (North) up, instead of 90 (zero to the right)?
% script file plotharmonic
% introduzir M2 S2 K1 O1 K2
amp = [1.0448,0.365,0.0712,0.0622,0.1027];
pha = [77.16,105.75,61.67,320.84,101.95];
rdir = pha * pi/180;
[x,y] = pol2cart(rdir,amp);
compass(x,y)

Risposta accettata

Abby Skofield
Abby Skofield il 7 Ott 2024
Starting in R2024b, the compassplot function can be used in place of compass to create arrows eminating from the origin of a polar axes. The PolarAxes class has many properties and several functions you can use to customize its appearance, like the location of theta==0. Note that compassplot can be combined in a PolarAxes with other plots like polarhistogram, polarplot, polarscatter, etc.
t = linspace(0,3*pi/2,10);
pax = polaraxes;
cp = compassplot(t,10:-1:1); % new in R2024b
pax.ThetaZeroLocation = "top";

Più risposte (1)

Paulo Silva
Paulo Silva il 21 Ago 2011
amp = [1.0448,0.365,0.0712,0.0622,0.1027];
pha = [77.16,105.75,61.67,320.84,101.95];
rdir = pha * pi/180;
[x,y] = pol2cart(rdir,amp);
compass(x,y)
view([-90 90])
  1 Commento
muhammad tariq
muhammad tariq il 21 Ago 2011
thanks paulo for ur kind help

Accedi per commentare.

Categorie

Scopri di più su Polar 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!

Translated by