Group Abstract Group Abstract

Message Boards Message Boards

0
|
7K Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

[?] Color coding scatterplots?

Posted 6 years ago
POSTED BY: Dave Lubbers
3 Replies
POSTED BY: Ian Williams

This will do the trick.

A = RandomReal[{0, 10}, {10000, 2}];
B = RandomChoice[{Red, Green, Blue}, 10000];

AB = GatherBy[Thread[{A, B}], Last];

col = AB[[All, 1, 2]];
points = AB[[All, All, 1]];

ListPlot[points, PlotStyle -> col]

enter image description here

POSTED BY: Martijn Froeling

Tried the wrappers. Worked great for small datasets. For large (500,000) datasets it was too slow. Had to go ahead and separate the data into multiple lists. The language R was the model.

POSTED BY: Dave Lubbers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard