Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13003 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2012-12-31 01:49 +0000 |
| Last post | 2012-12-31 01:49 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: question Bob Hanlon <hanlonr357@gmail.com> - 2012-12-31 01:49 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2012-12-31 01:49 +0000 |
| Subject | Re: question |
| Message-ID | <kbqqvb$807$1@smc.vnet.net> |
How about grids?
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;
Column[
Grid[#,
ItemSize -> 8,
Background -> colors[[n++]],
Alignment -> Left] & /@
clusters]
Column[
Grid[{#},
ItemSize -> 8,
Alignment -> Left,
Background -> colors[[Position[clusters, #][[1, 1]]]]] & /@
data]
Bob Hanlon
On Sun, Dec 30, 2012 at 12:58 PM, Hagwood, Charles R
<charles.hagwood@nist.gov> wrote:
> Bob,
>
> How does one put this is MatrixForm?
>
> Thanks.
>
> Charles
>
> ________________________________________
> From: Bob Hanlon [hanlonr357@gmail.com]
> Sent: Saturday, December 29, 2012 9:52 PM
> To: Hagwood, Charles R
> Cc: mathgroup@smc.vnet.net
> Subject: Re: question
>
> 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++]]] & /@
> clusters
>
> To color in place by cluster
>
> Style[#, Background -> colors[[
> Position[clusters, #][[1, 1]]
> ]]] & /@
> data
>
>
> Bob Hanlon
>
>
> On Sat, Dec 29, 2012 at 3:09 PM, Hagwood, Charles R
> <charles.hagwood@nist.gov> 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 wi=
th 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. H=
ow can this be done in Mathematica?
>>
>> Charles Hagwood
>>
>>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web