# \[Reddit-DiBB0118\] Interspecies comparison using RadarChart

**URL:** <https://community.wolfram.com/t/reddit-dibb0118-interspecies-comparison-using-radarchart/11769>\
**Category:** Staff Picks\
**Tags:** biological-sciences, data-science, graphics-and-visualization, staff-pick\
**Created:** [January 6, 2018, 2:58pm UTC](https://community.wolfram.com/t/reddit-dibb0118-interspecies-comparison-using-radarchart/11769 "2018-01-06T14:58:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzviovich](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dzviovich/32/27395_2.png) [@dzviovich](https://community.wolfram.com/u/dzviovich)\
**Post date:** [January 6, 2018, 2:58pm UTC](https://community.wolfram.com/t/reddit-dibb0118-interspecies-comparison-using-radarchart/11769/1 "2018-01-06T14:58:14Z")

</div>

_Click on the image to zoom. Then click your browser back button to return to reading the post._

* * *

 ![final.png](https://global.discourse-cdn.com/wolfram/original/2X/4/4f8604d44a00860ea212766ae7eecd3b4af9a3a7.png)

## Intro

This is a response to the _**[CALL] Reddit DataViz Battle JAN2018: Visualize the Growth Rates of Algae**_:

> [@\[CALL\] Reddit DataViz Battle JAN2018: Visualize the Growth Rates of Algae](https://wolfram.discourse.group/t/11750/1):
>
> Intro One of the most popular Reddit’s channels Data Is Beautiful (with multi-million membership of subscribers) has just started Battle Competitions for data visualizations that will run monthly. This is a call to Wolfram Community members to collaborate on JAN 2018 Battle. Direct reference to the JAN 2018 Battle: [Reddit](https://redd.it/7nm6ed)Solutions Heatmap of inter- and intra- species comparison by Vitaliy Kaurov: [http://community.wolfram.com/groups/-/m/t/1257577](http://community.wolfram.com/groups/-/m/t/1257577) Bubble chart for 4D data by Sander Huism…

## Details

Let’s bring the data in first.

```
raw = Drop[(Import["http://aquatext.com/tables/algaegrwth.htm", "Data"] /. "0..06" -> 0.06)[[2]]
      /. {"Temperature", ___} -> {"Temperature", 5, 5, 10, 10, 25, 25, 30, 30}, {3}];
data = raw[[3 ;;, 2 ;;]];

```

The first question I want to answer is: are there similarities in response across the different species?  
Let’s take advantage of the [ClusterClassify](http://reference.wolfram.com/language/ref/ClusterClassify.html) functionality from the wolfram language.

```
c = ClusterClassify[data, PerformanceGoal -> "Quality"];
clusters = c[data]
(*{2, 1, 1, 4, 1, 1, 1, 2, 2, 1, 5, 4, 3, 1, 1, 1, 1, 3, 2}*)

```

Five clusters were identified by the ClassifierFunction.  
Let us visually compare the five clusters to see how the algorithms has grouped the different species together.  
We’ll be utilizing [the Radar Chart Package](https://wolfram.discourse.group/t/7521/1) .

```
clusters = Flatten[Position[clusters, #]] & /@ Range[5];
{min, max} = Through[{Min, Max}[data]];
temperature = raw[[1, 2 ;;]];
lux = raw[[2, 2 ;;]];
axesLabel = 
 Flatten@Outer[
   Style[ToString[#1] <> "\[Degree]C / " <> ToString[#2] <> " lux"] &,
    Union@temperature, Union@lux];
clusterSpecies = raw[[# + 2, 1]] & /@ clusters;
<< RadarChart`
RadarChart[Rescale[data[[clusters[[#]]]], {min, max}], 
    Filling -> Axis, AxesLabel -> axesLabel, ImageSize -> Large, 
    ChartLegends -> clusterSpecies[[#]]] & /@ Range[5]

```

 ![9592Untitled.jpg](https://global.discourse-cdn.com/wolfram/original/3X/1/6/16c96582a4669b1ceb7895a63131b3fd52d79578.jpeg)

The clustering does a good job in identifying species that respond in a similar maner to the different experiments.  
We’ll use the clustering to group the different species in the final charts.

```
labelColors = {Black, Blue, Red, Purple, Darker@Green};
axesSpecies = 
  Flatten[Table[
    Style[StringReplace[#, " " -> "\n"], labelColors[[n]]] & /@ 
     clusterSpecies[[n]], {n, 5}]];
algae = Flatten[
  Table[{raw[[i + 2, 1]], temperature[[j]], lux[[j]], 
    raw[[i + 2, j + 1]]}, {i, Flatten@clusters}, {j, Length@lux}], 1];
myChart[temp_, lux_] := 
 Cases[algae, {_, temp, lux, v_} -> Rescale[v, {min, max}]]
ticks = Round[Rescale[Range[-0.5, 1.5, 0.5], {min, max}], 0.01];
ruleTicks = 
  With[{x = Style[ToString@#] & /@ ticks, 
    y = Style[#, Darker@Gray] & /@ {"-0.5", "0.0", "0.5", "1.0", 
       "1.5"}}, Thread[Rule[x, y]]];
Grid[Partition[
   Table[RadarChart[Table[myChart[i, j], {j, Union@lux}], 
     Filling -> Axis, AxesLabel -> axesSpecies, ImageSize -> 500, 
     PlotStyle -> {Blue, Red}, ChartLegends -> None, 
     AxesType -> "Star", FrameTicks -> ticks, 
     PlotLabel -> 
      Style["Temperature " <> ToString[i] <> " C\n", Bold, 
       FontSize -> 15], 
     Epilog -> {Darker@Gray, Circle[{0, 0}, ticks[[2]]], Dashed, 
       Circle[{0, 0}, #] & /@ Drop[ticks, {2}],}], {i, 
     Union@temperature}], 2], Frame -> All, 
  FrameStyle -> Gray] /. ruleTicks

```

 ![final.png](https://global.discourse-cdn.com/wolfram/original/2X/4/4f8604d44a00860ea212766ae7eecd3b4af9a3a7.png)

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [January 6, 2018, 11:26pm UTC](https://community.wolfram.com/t/reddit-dibb0118-interspecies-comparison-using-radarchart/11769/2 "2018-01-06T23:26:04Z")

</div>

![2015-11-02_10-07-11.png](https://global.discourse-cdn.com/wolfram/original/3X/5/0/50e59c9ead62f729e7130d3ea1482555a75602b6.png)

- Congratulations! This post is now a [Staff Pick](http://community.wolfram.com/content?curTag=staff+picks) as distinguished by a badge on [your profile](http://community.wolfram.com/web/dzviovich)! Thank you, keep it coming!

If you wish you now can submit your post to Reddit competition simply by entering your post link:

> [@\[Reddit-DiBB0118\] Interspecies comparison using RadarChart](https://wolfram.discourse.group/t/11769/1):
>
> Click on the image to zoom. Then click your browser back button to return to reading the post. Intro This is a response to the [CALL] Reddit DataViz Battle JAN2018: Visualize the Growth Rates of Algae: Details Let’s bring the data in first. raw = Drop[(Import["http://aquatext.com/tables/algaegrwth.htm", "Data"] /. "0..06" -\> 0.06)[[2]] /. {"Temperature", \_\_\_} -\> {"Temperature", 5, 5, 10, 10, 25, 25, 30, 30}, {3}]; data = raw[[3 ;;, 2 ;;]]; The first question I want t…

in a comment here: [Reddit](https://redd.it/7nm6ed)
