Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
2"""
3@file
4@brief Various functions about :epkg:`matplotlib`.
5"""
6import sys
9def mpl_switch_style(style="ggplot"):
10 """
11 Changes the graph style.
13 :param style: see `Customizing plots with style sheets
14 <http://matplotlib.org/users/style_sheets.html>`_
15 """
16 # This import was moved here because ths code is executed when
17 # the module is imported and for some reasons, it overides some of the settings
18 # sphinx is doing and graphs are not part of the documentation but show up
19 # in a separate window.
20 if "plt" not in sys.modules:
21 import matplotlib.pyplot as plt # pylint: disable=C0415
22 plt.style.use(style)