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.5.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: landborn-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 6b30ba0f346aa6bcf1298ed3ad03c0e585f1554f183f8e7a2d20119be547bdca
MD5 09d3318274aecebe2c6eaa5d0aab5049
BLAKE2b-256 7771ef68d55eb0dfb85020318c6a3272b7a257a0b0519d65633c264d8d70e93b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: landborn-0.2.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5b4be50862dfa90e541d749a10b988523b1e16815eaae0e22b1495d68fb57be6
MD5 62d64c0805c6e95eaf57ed09060fd9db
BLAKE2b-256 ccd16d8b50a4ba60b8317b3131c63325eb56b8d5778388c39c91dc98a725edd7

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