Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Group the values of a graph in four

조회 수: 1 (최근 30일)
Dionisio Mendoza
Dionisio Mendoza 2019년 2월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
I need to group in 4 the values of these two vectors of 1500 numbers ranging from -100 to 100, so that the following graph divided into 4 sections appears. I do not know whether to use axes or what procedure to execute
x=-100+(100+100)*rand(1500,1);
y=-100+(100+100)*rand(1500,1);
plot(x,y,'or')
  댓글 수: 3
Dionisio Mendoza
Dionisio Mendoza 2019년 2월 10일
I want to divide that graph like this
Rena Berman
Rena Berman 2019년 3월 5일
(Answers Dev) Restored edit

답변 (1개)

Walter Roberson
Walter Roberson 2019년 2월 11일
group = (x <= 0) * 2 + (y <= 0) + 1;
pointsize = 15;
scatter(x, y, pointsize, group);
colormap(jet(4))
  댓글 수: 4
Dionisio Mendoza
Dionisio Mendoza 2019년 2월 11일
i mean colors of each section
Walter Roberson
Walter Roberson 2019년 2월 11일
You can create a 4 x 3 matrix of color values and colormap() that matrix.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by