An open API service indexing awesome lists of open source software.

https://github.com/nrennie/rsspythemes

Python package for styling graphics for RSS publications.
https://github.com/nrennie/rsspythemes

python python-package

Last synced: 3 months ago
JSON representation

Python package for styling graphics for RSS publications.

Awesome Lists containing this project

README

          

# RSSpythemes

Python package for styling graphics for RSS publications. This package accompanies the *Best Practices for Data Visualisation* guidance, published by the Royal Statistical Society, which can be found at [royal-statistical-society.github.io/datavisguide](https://royal-statistical-society.github.io/datavisguide/). The R version of this package can also be found on [GitHub](https://github.com/nrennie/RSSthemes).

This package, the data visualisation guidance site and its content are under development, and the authors welcome feedback and contributions.

## Installation

Install from GitHub using `pip` with:

```bash
pip install git+https://github.com/nrennie/RSSpythemes.git#egg=RSSpythemes
```

Then load the package (and `matplotlib`):

```python
import RSSpythemes as rss
import matplotlib.pyplot as plt
```
## Examples

Using a single colour from stored variables:

```python
# data for bar chart
x = ['A', 'B', 'C']
value = [1, 2, 3]
# plot simple bar chart with blue bars
plt.bar(x, value, color=rss.signif_blue)
plt.show()
```
![](images/example_blue.png)

Using multiple colours from a palette:

```python
# get RSS colours
colors = rss.RSScols(name="signif_qual", n=3, palette_type="discrete")
# plot simple bar chart with multiple coloured bars
plt.bar(x, value, color=colors)
plt.show()
```
![](images/example_multi.png)

## Contributor guidelines

### To make a suggestion or ask a question

Please open up a discussion in the repository's [Discussions](https://github.com/royal-statistical-society/datavisguide/discussions) section.

### If you spot a bug or an error

Please either:

1. Raise an issue in the repository's [Issues](https://github.com/nrennie/RSSpythemes/issues) section, or
2. Fork this repository, edit the relevant file(s), and make a pull request against the `main` branch of this repository.

### If you want to add a new feature or section to the Python package:

1. Raise an issue in the repository's [Issues](https://github.com/nrennie/RSSpythemes/issues) section, tag it as an 'enhancement' and describe your proposed contribution.
2. Fork this repository and create a new branch named, e.g., `my-new-feature-or-section`.
3. Add content, code and files to your branch.
4. Make a pull request against the `main` branch of this repository.

Proposals for new features will be reviewed by the lead author team ("lead authors"):

- Andreas Krause

- Nicola Rennie

- Brian Tarran

Lead authors may offer feedback or suggestions to contributors before agreeing to merge pull requests. Lead authors reserve the right to refuse to merge pull requests, and the decision of the lead authors is final.

Use of, and all contributions to, our website and repository are governed by our [Code of Conduct](https://github.com/nrennie/RSSpythemes/blob/main/CODE_OF_CONDUCT.md).

This package is licensed under a [Creative Commons Attribution 4.0 (CC BY 4.0) International licence](https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1), meaning it can be used and adapted for any purpose, provided attribution is given to the original authors. By contributing to this guide, contributors agree to licence their work under the same terms.