Skip to main content

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: DataFrame containing 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 x column name).
  • ylabel: Label for the y-axis (defaults to the y column 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

GitHub LinkedIn Twitter Instagram Email Personal Web Page

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RainCloud-0.1.0.post1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RainCloud-0.1.0.post1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for RainCloud-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 a75742f71a4944d5a0a5102b434eee524a1c8ad39cada2ca7848ab18509662d8
MD5 9c5b5e4323f31127a8fe9753bc7d7256
BLAKE2b-256 d58622c379eab88b2a517b788da95bc6d36893d36ec68a718dd1e5606f757f54

See more details on using hashes here.

File details

Details for the file RainCloud-0.1.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for RainCloud-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cdf23c01e4a73db2ae175298cb5ba822a24cdc29effa016be3c1bf56103a962
MD5 3a1ae934cc3fd355168c6c971f461aa5
BLAKE2b-256 41f609cee056360986031fdb9667b21da2c170c6ce428f528cbc0b5229b219c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page