Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sliem/ScientificColorschemez
Use the fantastic colorschemes invented by @colorschemez in your matplotlib plots!
https://github.com/sliem/ScientificColorschemez
Last synced: 3 months ago
JSON representation
Use the fantastic colorschemes invented by @colorschemez in your matplotlib plots!
- Host: GitHub
- URL: https://github.com/sliem/ScientificColorschemez
- Owner: sliem
- License: mit
- Created: 2017-10-16T12:08:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:35:14.000Z (almost 2 years ago)
- Last Synced: 2024-07-04T02:12:44.486Z (4 months ago)
- Language: Python
- Homepage:
- Size: 895 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScientificColorschemez
I cannot be alone in marvelling in the fantastic colorschemes invented by [@colorschemez](https://twitter.com/colorschemez) hourly! Colors with such tantilising names such as *genethlialogical bluish purple* and *fond saffron*.
Of course, I have a burning need to use these in my day-to-day production of scientific figures. But staying updated with the fashion of the hour is simply too much work!
Enter ScientificColorschemez! This code downloads the latest innovation from [@colorschemez](https://twitter.com/colorschemez) and extracts the colors, ready to be used in your next plot!
## Example
To produce a simple example plot using the latest colorscheme we can write a small program:
```python
from ScientificColorschemez import Colorschemez
import matplotlib.pyplot as pltcs = Colorschemez.latest()
for name, hexcode in zip(cs.colornames, cs.colors):
print('%s: %s' % (hexcode, name))fig, ax = plt.subplots()
cs.example_plot(ax)
fig.savefig('latest.png', dpi=200 bbox_inches='tight')
```which, at the time of writing, produces the text
```
#9fbf16: erumpent dusty teal
#4c9085: genethlialogical bluish purple
#703ae6: untailed gross green
```and the figure
![example](./latest.png)
## Installation
I've have not bothered packaging the code due to lazyness (pull requests welcome!), so for now just download the code, the dependencies are:
[tweepy](www.tweepy.org/), [scikit-learn](http://scikit-learn.org/), [matplotlib](https://matplotlib.org/), [scipy](https://www.scipy.org/), [pillow](https://python-pillow.org/), and [requests](http://docs.python-requests.org/en/master/).
A Pipfile and a requirements.txt is included so you can easily install these dependencies.To use the code you need to reqister an Twitter app and give it access to your account. You need to generate various OAuth tokens and secrets and populate them in a config.py. To help you with that you can run the included program generate_config.py.