Skip to content
Blog
Go back

_Finding the Right Plot_ I really like data visualization, even if I can't claim to be any an expert at it. Today I wanted to...

Photo

Finding the Right Plot

I really like data visualization, even if I can’t claim to be any an expert at it. Today I wanted to plot some data in a flat file a coworker had generated. I first tried this with Google Docs because I just wanted something quick and dirty. But while I discovered some nice new features I wasn’t quite able to do what I wanted; so I switched to Python with the Matplotlib module.

In Matplotlib I was pretty quickly able to get what I wanted, but then there was the matter of deciding what I wanted. I went through the 4 plots above.

The first was the standard scatter plot, this is no good because close fluctuations in February just look scattered and hard to follow. Then I tried a line plot, but now I felt that it was hard to pick out the individual points. Since the data points are non-uniformly distributed this is key information. Next I tried a plot with both lines and points (actually the two plots overlaid). This produced the best of both worlds, you could see the individual data points as well as follow their progression.

But then I noticed there was a problem with this chart as well. The use of the line implies an interpolation between the data points that might not be true. For example the increase shown on the plot from mid-May to mid-June actually occurred suddenly, not gradually as the line implies.

Finally I settled on a bar plot. This allows us to see that the data is non-uniformly distributed. We can pick out each individual point, as well as follow the flow of data. Lastly, nothing about data markers is misleading about the nature of the data. Areas with no data look “empty”, which is exactly what they are.

Fun little project for the end of the workday.


Share this post on:

Previous Post
Hipster Passwords
Next Post
Just registered for [SciPy2012](http://conference.scipy.org/). This will be my first programming conference of any kind. I'm all...