mplstyle is a Python package, which allows matplotlib users to simplify the process of improving plots quality. Quite often font, size, legend, colors and other settings have to be changed to make graphs look better. Such changes can be saved and stored in your own plot style, which can automatically change the way of making plots by importing it as a usual Python toolbox. In other words, with mplstyle you can set plotting settings once and use your own configurations.
- numpy for mathematical operations
- matplotlib for making plots
- cycler
- from GitHub:
pip install git+https://github.com/tzipperle/mplstyle.git@master
- from source:
pip . install
Add the package mplstyle
automatically to sys.path:
- Create a directory anywhere, e.g.
C:\Users\Name\Documents\Python\Libs
. - Add the file
sitecustomize.py
to the site-packages folder of the Python installation, i.e. inC:\Anaconda3\Lib\site-packages
(for all users) or site.USER_SITE (for a single user). - This file then is filled with the following code:
import site
site.addsitedir(r'C:\Users\Name\Any\Folder\You\Like\Libs')
- The directory now is automatically added to sys.path in every (I)Python session.
Package site, that is automatically imported during every start of Python, also tries to import the package sitecustomize for custom package path modifications.
Source: Stack Overflow