This repository was inspired by a post on my blog related to the use of style sheets on Matplotlib. The main idea is to create a file with some of the parameters that want to be defined.
You can use the URL for the style sheet in Python, as the example below.
import numpy as np
import matplotlib.pyplot as plt
repo = "https://raw.githubusercontent.com/nicoguaro/matplotlib_styles/master"
style = repo + "/styles/clean.mplstyle"
with plt.style.context(style):
x = np.linspace(0, 4, 201)
cos = np.cos(np.pi*x)
sin = np.sin(np.pi*x)
plt.plot(x, sin, x, cos)
plt.xlabel("x")
plt.ylabel("y")
plt.savefig("sin_cos-ex.svg")
You should get the following result
If you want to add style sheets to the repository in some of the groups you can
create a Pull Request with the new file under the folder styles
.
Style sheets and code are availabe under MIT license.