Customization
On the journey through the lands of matplotlib, one of the signposts for intermediate territories is an increased need for fine-grained control over the libraries in the ecosystem. In our case, this means being able to tweak matplotlib for particular use cases such as specialty scales or projections, complex layouts, or a custom look and feel.
Creating a custom style
The first customization topic that we will cover is that of the new style support introduced in matplotlib 1.4. In the previous notebook, we saw how to get a list of the available styles:
In [2]: print(plt.style.available) ['bmh', 'ggplot', 'fivethirtyeight', 'dark_background', 'grayscale']
Now, we're going to see how we can create and use one of our own custom styles.
You can create custom styles and use them by calling style.use
with the path or URL to the style sheet. Alternatively, if you save the <style-name>.mplstyle
file to the ~/.matplotlib/stylelib
directory (you may need to create it...