How can I get matplotlib graphics in a modern style that are often found in iPython laptop examples?

Take this page , for example, a sample of which is posted below:

enter image description here

It has matplotlib examples with a gray background and a finer color, but when I use the same examples, I get more traditionally painted plots with a white background and strong colors. It also looks like the style used in pandas documentation .

How to change default style locally to match their style?

+6
source share
2 answers

If you are viewing a linked page, the following line is shown above the Pandas section of the Markup :

If you want your stories to look beautiful like mine, steal the matplotlibrc file from Huy Nguyen .

The message has a link to this meaning , which contains the matplotlibrc file. Make sure you read all this and configure it, for example, it has MacOSX as its backend, which you can change.

To use the file, save it as ~/.matplotlib/matplotlibrc and restart all running IPython instances. Now your stories look more beautiful :)

+5
source

As MattDMo noted, using reasonable matplotlibrc really helps. The book Probabilistic Programming and Bayesian Methods for Hackers also uses the nice matplotlibrc . For some examples, see this .

Recently, I have been using the seaborn package instead of the custom matplotlibrc not only because it makes my stories great, but also because it adds some features to visualize distributions, linear models, and time series.

+3
source

All Articles