Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
color figure

Subject: color figure

From: Frank

Date: 19 Apr, 2012 09:58:21

Message: 1 of 5

Hello, I want to plot some squares representing stations and a large circle whose inner area represents receiving zone. Furthermore, I want the area inside the circle red so that I can label the red color in the legend 'receiving zone'. How can I do it? Thanks.

Subject: color figure

From: Frank

Date: 23 Apr, 2012 09:05:07

Message: 2 of 5

Can anyone help?

Subject: color figure

From: ImageAnalyst

Date: 23 Apr, 2012 12:38:12

Message: 3 of 5

On Apr 19, 5:58 am, "Frank " <allinone_2...@yahoo.com.hk> wrote:
> Hello, I want to plot some squares representing stations and a large circle whose inner area represents receiving zone. Furthermore, I want the area inside the circle red so that I can label the red color in the legend 'receiving zone'. How can I do it? Thanks.

--------------------------------------------
Use the "rectangle" function, and the "text" function.

Subject: color figure

From: ImageAnalyst

Date: 23 Apr, 2012 12:39:47

Message: 4 of 5

On Apr 23, 8:38 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
> On Apr 19, 5:58 am, "Frank " <allinone_2...@yahoo.com.hk> wrote:
>
> > Hello, I want to plot some squares representing stations and a large circle whose inner area represents receiving zone. Furthermore, I want the area inside the circle red so that I can label the red color in the legend 'receiving zone'. How can I do it? Thanks.
>
> --------------------------------------------
> Use the "rectangle" function, and the "text" function.

-------------------------------------------------
Or see the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F

Subject: color figure

From: Frank

Date: 25 Apr, 2012 04:02:28

Message: 5 of 5

Thanks a lot.

I used the rectangle function but cannot label the zone in legend. How can I label it?

Thanks.

R = 10;
M = 6;
m = 0:M-1;
theta = 2*pi/M*m;
X = R*[cos(theta); sin(theta)];

figure
rectangle('Position',[-1.5*R, -1.5*R, 3*R, 3*R], 'Curvature',[1,1], 'FaceColor', [0.870588243007660 0.921568632125854 0.980392158031464]), grid on, hold on;
plot(X(1, :), X(2, :), 'bs'), grid on, hold on
legend('zone', 'receiver')% only receiver appears
xlabel('x (m)')
ylabel('y (m)')
axis square;

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us