Radar Diagrams: Electrical Properties of Brain Cells

Radar plots are also known as spider web or polar plots. These charts are useful for conveying information about multiple quantitative variables using multiple axes, arranged in a circle. In R it is technically possible to use ggplot2 to make these kinds of charts but the fmsb package allows for much easier and more readily customizable charts. (See fmsb’s CRAN page and RDocumentation page for more details.)

The Data: NeuroElectro Database of Electrical Properties of Brain Cells

NeuroElectro is a great resource for electrophysiologists in neuroscience. This project extracts information about the electrophysiological properties of neurons from existing literature and integrates it into a centralized database. There are dozens of measurements documented for a large number of cell types in multiple species and preparations.

Citation: NeuroElectro: a window to the world’s neuron electrophysiology data. Frontiers in Neuroinformatics, April 2014 Tripathy SJ, Savitskaya J, Burton SD, Urban NN, and Gerkin RC Description: A methods paper outlining the text-mining and manual curation methodology used to construct the NeuroElectro resource.

Representaiton Description

For my visualization I am focusing on in vitro patch clamp data in mouse tissue, because that’s what I work with in the lab. I decided to feature only 6 cell types which were more or less randomly chosen using my personal bias. I chose to focus on only 5 physiological properties even though there were many more in the dataset. Each radar plot here represents a single cell type. My intent is to showcase electrical properties of these cells for quick comparison. This is a lot of data in a small space. The same data could be conveyed using five bar graphs instead (in fact, if you were interested in the absolute measurements, bar graphs would be better.

For the fmsb package I need to include the maximum and minimum data for each variable so that it knows how to scale its axes. Here is the data that I am working with:

Input Resistance Resting Membrane Potential* Capacitance Rheobase Spike Amplitude
Max 221.53 81.64 614.61 1300.00 86.42
Min 0.00 0.00 0.00 0.00 0.00
Neurons
Neocortex pyramidal cell layer 5-6 162.13 70.35 89.23 166.11 79.33
Neocortex basket cell 158.96 67.41 51.31 281.98 61.22
Hippocampus CA1 pyramidal cell 155.91 66.55 94.55 75.60 86.42
Neostriatum medium spiny neuron 121.20 81.64 80.50 263.62 81.59
Cerebellum Purkinje cell 125.31 62.02 614.61 1300.00 81.32
Hippocampus CA3 pyramidal cell 221.53 67.28 208.54 92.00 82.25
* Note: Resting membrane potential is shown positive, but is in fact negative. This is because the radar plot struggles with negative values.

How to interpret

As I mentioned above, each radar plot represents a single cell type. Here, color serves no purpose other to indicate that each plot is a unique cell type. Each of the five axes represents a different measurement and has a different scale. The minimum is 0 in all cases. The maximum is indicated y the number at the apex of the axis. The lines indicate the percent of maximum from 0% to 100%, with each segment representing 25% of the maximum. This is indicated on the vertical axis, the only one with labels at each segment. It’s easy to see, for example, that cerebellar Purkinje cells have significantly higher cell capacitance and rheobase compared to other cell types. We can also see that all of this cell types have similar restine membrane potentials.

Presentation Tips

While fmsb will allow you to create as many axes as you want, I wouldn’t do more than 6. Beyond 6 things start to get difficult to interpret. Additionally, it is easiest to understand radar plots when each of the axes have the same scale (which mine do not). If the axes do have different scales, try to be as explicit as possible with labels. Unfortunately only the “center” axis (the vertical one) can show labels at each segment break. While the fmsb package contains many variables that can be modified to customize the plot, I found that it lacks in specifying text. For example, there is no way to adjust the text justification (left, center, right) of only one text element, you can only do it for all or none. You also cannot manually move text labels; this results in a lot of overlapping text, requiring you to get creative.

Variations and Alternatives

There is a lot of hate for radar plots in the data viz world. In most cases, a series of bar graphs or a parallel coordinate plot conveys the data in a more easily interpretable way, albeit not as cool looking.

The Radar Plot

The most basic radar plot

Before getting too fancy, what does fmsb do with basically no embelishments? For this, we’ll use just one cell type. I decided to use Neocortex pyramidal cell (layer 5/6) data for this example. The top two rows of the data frame represent the axis max and min values. The next row(s) are the actual data. It should look like this:

## # A tibble: 3 × 5
##     rin   rmp   cap  rheo apamp
##   <dbl> <dbl> <dbl> <dbl> <dbl>
## 1  222.  81.6 615.  1300   86.4
## 2    0    0     0      0    0  
## 3  162.  70.3  89.2  166.  79.3

Now, feed it into fmsb::radarchart():

par(mar=c(0,0,1.2,0)+0.1) # Set the margins
radarchart(cortexpyramidal, title="Neocortex pyramidal cell layer 5-6") # Make the default radar plot

The embelished radar plot

  • I used par() to customize the output. You can do a lot with par. Find helpful documentation here.
  • There’s a lot you can do with fmsb::radarchart()! For full documentation, go here.
# Define colors for border and shading
bordercol=colormap(colormap=colormaps$portland, nshades=6, alpha=1)
shadingcol=colormap(colormap=colormaps$portland, nshades=6, alpha=0.3)

# Set the titles
titles <- as.character(neuron.data$NeuronName[3:8])

# Split the graphic into 6 frames
par(mar=c(0.1,0.5,0.5,0.1)+0.1) # Define margins
par(mfrow=c(2,3)) # 2 rows, 3 column layout

# Loop through each subplot to build the 6 panels
neuron.data.input <- neuron.data %>% select(-NeuronName) # Get rid of the "NeuronName" column

for(i in 1:6){

  # Build the radarChart
  radarchart(neuron.data.input[c(1,2,i+2),], axistype=3, 
  
    # Build polygon
    pcol=bordercol[i] , pfcol=shadingcol[i] , plwd=2, plty=1 , 
  
    # Define grid properties
    cglcol="grey", cglty=1, axislabcol="black", 
    # The weird spaces below are because you cannot define text alignment for individual compondents of the graph and text was overlapping.
    paxislabels = c(NA,"\n-80mV        ","615pF","1300pA","\n        85mV"), 
    cglwd=0.8, 
    caxislabels = c("0%","25%","50%","75%","220MOhm"),
    
    # Add titles
    title=titles[i],
    
    # Customize labels
    vlabels=c(expression('R'['in']), expression("V"["m"]), "Capacitance", "Rheobase", "Spike\nAmp"),
    vlcex=1.2, palcex=0.9, calcex=0.9,
    )
}

Jennifer Jahncke
Jennifer Jahncke
Postdoctoral Scholar

I am a neuroscientist studying how brain cells form and maintain connections.

Related