compass plot

7 Ansichten (letzte 30 Tage)
muhammad tariq
muhammad tariq am 21 Aug. 2011
Beantwortet: Abby Skofield am 7 Okt. 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)

Akzeptierte Antwort

Abby Skofield
Abby Skofield am 7 Okt. 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";

Weitere Antworten (1)

Paulo Silva
Paulo Silva am 21 Aug. 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 Kommentar
muhammad tariq
muhammad tariq am 21 Aug. 2011
thanks paulo for ur kind help

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Polar Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by