Python has some excellent plotting packages. This post looks at creating static plots for publication or various other uses. I use two main packages for my plotting.

1. Matplotlib - Documentation - This is the main plotting package for python. It is capable of producing publication quality plots and can do just about everything you can imagine. It has a rich history in the python world.

2. Seaborn - Documentation - Seaborn is what makes your plots pretty. It is extremely easy to use and you can almost just set it and forget it.

If you are reading this, I assume you have seen the default matplotlib format–I do not find it particularly pleasing to the eye. To combat this, after my usual imports of matplotlib, numpy and whatever packages I need for a particular task, I import Seaborn and set it as the default style for my ipython notebook or any other plots I will save. This is simply done as:

In lines 1 and 2 above, I import seaborn and then set it as my default plotting style. This is all it takes to make more visually appealing plots. In lines 4 and 5, I set some more parameters that I like particularly. Line 4 changes the default seaborn style to ticks. There are actually four styles that can be set depending on preference:

1. darkgrid
2. whitegrid
3. dark
4. white
5. ticks

I usually prefer ‘ticks’. Line 5 sets the context with ‘notebook’ being the defualt. There are four different contexts that can be set:

1. paper
2. notebook
3. talk
4. poster

Also in line 5, I set the font_scale to 1.5. This increases the font on axes and titles. I find the default to be a little small. The following will show some of my favorite recipes.