![]() To run the Python code in this post on your machine, you’ll need pandas, numpy, and matplotlib installed. Note: This post can be launched as a Notebook by clicking here. In this post, I’ll give you the code to get from a more traditional data structure to the format required to use Python’s ax.contour function. ![]() The most difficult part of using the Python/ matplotlib implementation of contour plots is formatting your data. This isn’t to say Pythonic contour plots don’t come with their own set of frustrations, but hopefully this post will make the task easier for any of you going down this road. Of course, you can make anything look great with enough effort, but you can also waste an excessive amount of time fiddling with customizable tools. While I usually use R/ggplot2 to generate my data visualizations, I found the support for good-looking, out-of-the-box contour plots to be a bit lacking. While 3-D surface plots might be useful in some special cases, in general I think they should be avoided since they add a great deal of complexity to a visualization without adding much (if any) information beyond a 2-D contour plot. When I have continuous data in three dimensions, my first visualization inclination is to generate a contour plot.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |