Skip to main content

Landborn Visualization Library

Project description

Landborn: Data Visualization Package

Landborn is a comprehensive Python library designed for creating visually appealing, informative data visualizations with ease. It bridges the complexity of matplotlib and Plotly, providing a simple interface to generate complex graphs suitable for a wide array of data analysis applications. This document provides an overview of Landborn's primary functions, usage examples, and guidance on how to effectively utilize the library to enhance your data visualization tasks.

Core Functions

Scatter Plot

  • scatterplot(df, xvar, yvar, color, colormap, size, marker, ax, save_path): Generates scatter plots using either matplotlib or Plotly based on the global backend setting in Config.plot_backend. It supports customization of color, size, and marker type.

Line Plot

  • lineplot(df, xvar, yvar, color, colormap, size, style, marker, save_path): Draws line plots connecting data points in sequence, ideal for visualizing time series or continuous data. Style and marker customization is available.

Bar Plot

  • barplot(df, xvar, yvar, orientation, color, save_path, axis): Creates vertical or horizontal bar plots. The orientation parameter controls the bar direction.

Joint Plot

  • jointplot(x, y, ax, color, title, save_path): Combines scatter and line plots on shared axes to display both individual data points and their sequential connections.

Swarm Plot

  • swarmplot(df, categorical_data, numerical_data, r, ax, save_path): Positions data points to avoid overlap, making it ideal for visualizing distributions across categories.

Colormap Functions

Plot Colormap Gradient

  • plot_colormap_gradient(colormap_name, save_path): Displays the gradient of a specified colormap, aiding in colormap selection and comparison.

Plot Colormap in RGB Space

  • plot_colormap_in_rgb_space(colormap_name, num_samples, save_path): Visualizes the color space distribution of a colormap by plotting its colors in RGB space.

Create Custom Colormap

  • create_custom_colormap(num_points, title): Generates a custom colormap based on specified RGB functions, allowing for personalized visualizations.

Delta E and Lightness

  • delta_e(colormap_name, num_points, save_path): Calculates the perceptual difference (ΔE) across a colormap, providing insights into its perceptual uniformity.

  • delta_e_lightness(colormap_name, num_points, save_path): Focuses on the lightness variation in ΔE calculations, highlighting changes in perceived brightness across a colormap.

Convert Colormap for Colorblindness

  • convert_colormap_for_colorblindness(colormap, cvd_type, num_points): Adapts a colormap to be more accessible for viewers with color vision deficiencies (CVD), ensuring inclusivity in visualizations.

Compare Colormaps

  • compare_colormaps(cmap1, cmap2, save_path): Places two colormaps side by side for direct comparison, aiding in the selection process.

Heatmap Functions

Gradient Heatmap

  • gradient_heatmap(data, colormap, title, x_label, save_path): Creates a heatmap representing the distribution of a single variable, with color intensity corresponding to value magnitude.

Month-Year Heatmap

  • month_year_heatmap(df, title, colormap, save_path): Visualizes data across months and years, with each cell's color intensity reflecting the data's magnitude. Suitable for tracking trends and patterns over time.

Plotly vs Matplotlib

All functions default to 'matplotlib'

The following functions support both backends:

  • scatterplot
  • lineplot
  • barplot
  • gradient_heatmap
  • month_year_heatmap

To switch backends:

set_plot_backend('plotly') or set_plot_backend('matplotlib')

Installation

Install Landborn directly from PyPI using pip:

pip install landborn

Testing

To run the tests, inside main dir, run pytest tests/tests.py

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

landborn-0.2.7.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

landborn-0.2.7-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file landborn-0.2.7.tar.gz.

File metadata

  • Download URL: landborn-0.2.7.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for landborn-0.2.7.tar.gz
Algorithm Hash digest
SHA256 62bb252ae56e48472036877e5863165292a37f7e30641e91fc944fa0a772c3e7
MD5 db50ccd4c6ec963dd4409e556f1b4f01
BLAKE2b-256 bc26e8041d68a5ffac2605b286085234376e4226f7b3c03817c6fa2b931f2087

See more details on using hashes here.

File details

Details for the file landborn-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: landborn-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for landborn-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 41ab6431ff9613594e9a0521b88eb6492aa32b57c976ab2d11536b40e358a76d
MD5 b2335cd3ff50d2632b452d0f64b0e435
BLAKE2b-256 ac8ff93ee46b8769fc1d3c43d53f59e93070cf7a2ac9233cdfe2045374015698

See more details on using hashes here.

Supported by

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