Domanda

I have a map and wish to draw a RF propagation path on it, where signal fades with distance. I am picturing 4 circles on the same axis coordinate. These four circles have different colors and different radius. Much like a target board.

Is it possible to draw these by using one circle? Or do I have to repeatedly iterate the circles with different radius?

È stato utile?

Soluzione

Possible with misuse of scatter.

% set up centre and number of circles
x = 5;
y = 5;
n = 4;
r = 25; % radius multipler

scatter(repmat(x,[n,1]),repmat(y,[n,1]),pi.*((n:-1:1)*r).^2,(1:n),'fill');
colormap jet;

enter image description here

Notes: pi.*((n:-1:1)*25).^2: scatter size is in points squared. Also, to get the smaller circles to overplot the larger, n:-1:1 is used rather than 1:n so that the largest plots first.

Altri suggerimenti

You may work with cylinder and set a top view point that squeezes the Z dimension.

The following plot

enter image description here

is produced by

nb_points = 100;
vect_profile = 1:-0.001:0;

[X,Y,Z] = cylinder(vect_profile, nb_points);

figure;
subplot(1,2,1);
h(1) = surf(X,Y,Z);
hold on;
h(2) = surf(X*0.6+2, Y*0.6+1.5, Z); %modify origins and scale of cylinder
h(3) = surf(X*0.2, Y*0.2+2,Z);      

subplot(1,2,2);
h(4) = surf(X,Y,Z);
hold on;
h(5) = surf(X*0.6+2, Y*0.6+1.5, Z);
h(6) = surf(X*0.2, Y*0.2+2,Z);
view(0,90)

set(h, 'EdgeColor', 'None');
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top