How do I have different colours for each plot even having a different option in the popupmenu

조회 수: 3 (최근 30일)
I have created a GUI to plot data for 2 sensors using popupmenu to choose which sensor to plot in a single axes. Each sensor have 2 column of data, so total of 4 columns' data. I want to plot such that each column's data have different colours. Sensor 1 will have 2 column of data where one should be in red and yellow while in sensor 2 will have 2 column's data where the colours are blue and black

답변 (1개)

KSSV
KSSV 2021년 11월 27일
x = (1:10)' ;
A = rand(10,3) ;
figure
plot(x,A(:,1),'r',x,A(:,2),'b',x,A(:,3),'g')
figure
plot(x,A)
figure
hold on
plot(x,A(:,1),'r')
plot(x,A(:,2),'b')
plot(x,A(:,3),'g')
  댓글 수: 2
Chen Liang Teoh
Chen Liang Teoh 2021년 11월 27일
I mean that after i chose sensor 2 the colours are still the same as sensor 1. I want it to be different. How do I do that?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by