The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: question
Replies: 2   Last Post: Dec 30, 2012 8:49 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bob Hanlon

Posts: 906
Registered: 10/29/11
Re: question
Posted: Dec 29, 2012 10:25 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

colors = {Red, Blue, Green};

r = 20;
c = 4;
(* r = 88 and c = 9 for your example *)

data = RandomReal[1, {r, c}];

clusters = FindClusters[
data, Length[colors]];

n = 1;
Style[#, Background ->
colors[[n++]]] & /@

To color in place by cluster

Style[#, Background -> colors[[
Position[clusters, #][[1, 1]]
]]] & /@

Bob Hanlon

On Sat, Dec 29, 2012 at 3:09 PM, Hagwood, Charles R
<> wrote:
> I have a matrix, say 88 x 9 . I use FindCluster to find say 3 clusters, i.e. the 88 rows are partitioned into 3 clusters. I want to use 3 colors to highlight these rows. For example, the rows in cluster 1 highlighted with color1, cluster 2 highlighted with color2 and cluster 3 highlighted with color 3. I want to be able to read the data underneath the highlight. How can this be done in Mathematica?
> Charles Hagwood

Date Subject Author
Read Re: question
Bob Hanlon
Read Re: question
Bob Hanlon

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.