Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Mastering Matplotlib
  • Toc
  • feedback
Mastering Matplotlib

Mastering Matplotlib

By : Duncan M. McGreggor, Duncan M McGreggor
3.5 (8)
close
Mastering Matplotlib

Mastering Matplotlib

3.5 (8)
By: Duncan M. McGreggor, Duncan M McGreggor

Overview of this book

If you are a scientist, programmer, software engineer, or student who has working knowledge of matplotlib and now want to extend your usage of matplotlib to plot complex graphs and charts and handle large datasets, then this book is for you.
Table of Contents (11 chapters)
close
10
Index

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 ~...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete