Group the values of a graph in four

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 commentaires

Walter Roberson
Walter Roberson le 10 Fév 2019
What should be the criteria to divide them?
The graph already appears, so it is not clear what you are asking for?
Dionisio Mendoza
Dionisio Mendoza le 10 Fév 2019
I want to divide that graph like this
Rena Berman
Rena Berman le 5 Mar 2019
(Answers Dev) Restored edit

Réponses (1)

Walter Roberson
Walter Roberson le 11 Fév 2019
group = (x <= 0) * 2 + (y <= 0) + 1;
pointsize = 15;
scatter(x, y, pointsize, group);
colormap(jet(4))

4 commentaires

Dionisio Mendoza
Dionisio Mendoza le 11 Fév 2019
Thanks,It's pretty similar to what I'm looking for, but how can I define the chords of each section and its character?
Walter Roberson
Walter Roberson le 11 Fév 2019
I do not know what you mean by a "chord" of a section, or "character" of a section.
Dionisio Mendoza
Dionisio Mendoza le 11 Fév 2019
i mean colors of each section
Walter Roberson
Walter Roberson le 11 Fév 2019
You can create a 4 x 3 matrix of color values and colormap() that matrix.

Cette question est clôturée.

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by