The data I’d like to visualize is my personal sleep data sourced from a Zeo (www.myzeo.com if you’re not familiar). The data is ~50×1000 table with each row representing a night of sleep and each column is an integer from 0-5 representing the sleep ‘type’ recorded in a 30 second interval. So the first column is the score for the 1st 30 seconds of sleep, the 2nd column the score for the 2nd 30 second interval of sleep and so on.
To start, I’d like to simply map one row (night) of sleep data where the sleep type is mapped to a color. I’ve been browsing matplotlib’s gallery and examples, but its a bit overwhelming to a beginner to figure out what the most appropriate plot type is.
It seems like this color bar (2nd one?) might be close to what I’m looking for, but I’m not sure.
Any recommendations?
This is an extremely specific and narrowly focused question. That said, I see two problems with the color bar visualization proposed:
It only differentiates between different data segments by color. A short interval of sleep disruption may be too narrow to be easily visible (a slice 1 pixel in width is not very large)
Depending on your audience, many color palettes don’t cater well to those with color blindness. That could further degrade the ability of a colorbar based plot to convey information.
If you look at the example charts on the MyZeo site, they use a bar chart that conveys information based on color and height. So long as the number of intervals sampled is reasonable, a bar or line chart would be fair choices for your data. (Though if your dataset would require 1,000 separate bars, you may want to consider dithering your dataset so that it displays cleanly)
This matplotlib example appears to provide a bar chart with coloring based on height:
http://matplotlib.org/examples/pylab_examples/hist_colormapped.html
If you do become interested in data visualization, books such as Tufte’s The visual display of quantitative information may be worth the read: it’s a classic primer on the design choices involved when displaying several dimensions of information on the same figure.