Thread Subject: plot color

Subject: plot color

From: Vihang Patil

Date: 19 Feb, 2009 13:08:02

Message: 1 of 1

Hello
I am designing a system to check the continuity of a rotary switch respect to its angle. I would like to plot the continuity vs angle in both ClockWise and AntiClockwise direction for about x number of cycles.
Say for example
angle = [0:0.9:10];
continuity_cw = [0 0 0 0 0 0 1 1 1 1 0 0];
continuity_acw = [0 0 0 0 0 1 1 1 1 0 0 0];

I have designed a GUI such that
axes(handles.axes1);
x = NaN(1,length(angle));
handles.plot = plot(x,x);

Now in my timer function, I want to plot the continuity_cw vs angle and continuity_acw vs angle in two different colors. But I am unable to do so.

I have used the following command in my timer function
set(handles.plot,'XData',angle,'YData',continuity_cw); %plot CW data
set(handles.plot,'Color','r');
set(handles.plot,'XData',angle,'YData',continuity_acw); %plot ACW data
set(handles.plot,'Color','b');

But it plots in one color only. Also my data of the continuity_cw also gets overwritten by continuity_acw

My question is how to plot the above in two different color ?

Regards
Vihang

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
mutliple plot c... Vihang Patil 19 Feb, 2009 08:10:04
rssFeed for this Thread

Contact us at files@mathworks.com