A package for creating raincloud plots
Project description
RainCloud
RainCloud is a Python package that provides a convenient function to create raincloud plots; a combination of density plots, box plots, and strip plots that provide a detailed visualization of data distributions.
Features
- Raincloud Plots: Visualize the distribution of your data in a detailed and intuitive way.
- Customization Options: Easily customize the plot with options for titles, labels, colors, orientation, and more.
- Thunder Mode: Connect the means of each group with a point plot to emphasize differences between groups.
Installation
You can install the RainCloud package directly from PyPI:
pip install RainCloud
Usage
Here's how you can use the create_raincloud_plot function:
import pandas as pd
from RainCloud.raincloud import create_raincloud_plot
# Generate example data
np.random.seed(42)
num_entries = 1000
cities = ['Tunis', 'Sousse', 'Sfax', 'Gabes', 'Djerba']
temperatures = np.random.normal(loc=20, scale=10, size=num_entries)
city_offsets = {
'Tunis': 10,
'Sousse': 5,
'Sfax': 0,
'Gabes': -5,
'Djerba': -1
}
temperatures = np.random.normal(loc=70, scale=15, size=num_entries)
city_choices = np.random.choice(cities, num_entries)
offsets = np.array([city_offsets[city] for city in city_choices])
adjusted_temperatures = temperatures + offsets
df = pd.DataFrame({
'city': city_choices,
'temp': adjusted_temperatures
})
# Create a raincloud plot
create_raincloud_plot(
df=df,
x='city',
y='temp',
title='Raincloud Plot of Temperatures by City',
xlabel='City',
ylabel='Temperature (°F)',
thunder=True
)
Parameters
- df:
DataFramecontaining the data to be plotted. - x: Column name for the x-axis data.
- y: Column name for the y-axis data.
- title: Title of the plot.
- xlabel: Label for the x-axis (defaults to the
xcolumn name). - ylabel: Label for the y-axis (defaults to the
ycolumn name). - palette: Color palette for the plot (default:
'Set2'). - alpha: Transparency level for the plot elements (default:
0.6). - orient: Orientation of the plot,
'h'for horizontal or'v'for vertical (default:'h'). - figsize: Size of the figure (default:
(10, 10)). - thunder: Whether to connect the means of each group with a point plot (default:
False).
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Contact
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file RainCloud-0.1.0.post1.tar.gz.
File metadata
- Download URL: RainCloud-0.1.0.post1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a75742f71a4944d5a0a5102b434eee524a1c8ad39cada2ca7848ab18509662d8
|
|
| MD5 |
9c5b5e4323f31127a8fe9753bc7d7256
|
|
| BLAKE2b-256 |
d58622c379eab88b2a517b788da95bc6d36893d36ec68a718dd1e5606f757f54
|
File details
Details for the file RainCloud-0.1.0.post1-py3-none-any.whl.
File metadata
- Download URL: RainCloud-0.1.0.post1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cdf23c01e4a73db2ae175298cb5ba822a24cdc29effa016be3c1bf56103a962
|
|
| MD5 |
3a1ae934cc3fd355168c6c971f461aa5
|
|
| BLAKE2b-256 |
41f609cee056360986031fdb9667b21da2c170c6ce428f528cbc0b5229b219c6
|