Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicoguaro/matplotlib_styles
Matplotlib style sheets allow to stylize plots easily.
https://github.com/nicoguaro/matplotlib_styles
matplotlib matplotlib-style-sheets
Last synced: about 2 months ago
JSON representation
Matplotlib style sheets allow to stylize plots easily.
- Host: GitHub
- URL: https://github.com/nicoguaro/matplotlib_styles
- Owner: nicoguaro
- License: mit
- Created: 2019-03-07T16:31:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-10T03:04:11.000Z (3 months ago)
- Last Synced: 2024-07-04T01:01:07.146Z (3 months ago)
- Topics: matplotlib, matplotlib-style-sheets
- Language: Python
- Homepage:
- Size: 1.24 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Matplotlib style sheets
This repository was inspired by a post on [my blog](https://nicoguaro.github.io/posts/matplotlib_styles/) 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.## How to use it?
You can use the URL for the style sheet in Python, as the example below.```python
import numpy as np
import matplotlib.pyplot as pltrepo = "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
## How to contribute?
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``.## License
Style sheets and code are availabe under [MIT license](https://opensource.org/licenses/mit-license.php).