lizard-bio / nature-grade-visualization-playground

Liz.inno.3 - Playground repo for the BioLizard data visualization packages
MIT License
1 stars 0 forks source link

Nature-Grade Visualization

Introduction

Liz.inno.3

Data visualization is an important aspect the work we do at BioLizard. To ensure that we follow best practices as much as possible, we initiated the "nature-grade visualization" innovation project. One of the goals of this project to develop R and Python packages to add a consistent visual style to our figures. Some prime candidates are ggplot2, matplotlib, and seaborn). This repository acts as a "pre-production" playground to work on this development.

For a list of guidelines and best practices that everyone within BioLizard should adhere to, please refer to this Notion document. Turn to this one for a more in depth discussion about some of the data visualization do’s and don’ts.

Packages in This Repository

This repository contains two key packages:

  1. BioLizardStyleR - An R package designed for ggplot2.
  2. BioLizardStylePython - A Python package designed for matplotlib, also compatible with seaborn.

Developed by Robbe Neirynck during an internship at BioLizard, under the supervision of Alexander Koch. Development was continued by Anikó Meijer.

Installation

Installing BioLizardStyleR

if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}

devtools::install_github("lizard-bio/nature-grade-visualization-playground", subdir="BioLizardStyleR", build_vignettes = TRUE)

Installing BioLizardStylePython

1. Extra requirements

BioLizardStylePython relies on the colorspace package, which is not available on the Python Package Index (PyPI). However, it is hosted on GitHub and needs to be installed directly from there. To install the colorspace package, please run the following command in your terminal:

pip install git+https://github.com/retostauffer/python-colorspace.git

Once you've successfully installed colorspace, you can proceed with the installation and usage of BioLizardStylePython.

2. Package Installation

The BioLizardStylePython package is available on PyPI and can be easily installed using:

pip install BioLizardStylePython

Documentation

A detailed description of the functionalities in each package can be found on these help pages:

  1. R: https://lizard-bio.github.io/nature-grade-visualization-playground/BioLizardStyleR/
  2. Python: https://lizard-bio.github.io/nature-grade-visualization-playground/BioLizardStylePython/

Quick start

For installation details, usage examples, and example workflows, please refer to the the help pages. Most information below this point is general. Both packages have three main components:

1. Styling Function: lizard_style()

This function applies a BioLizard aesthetic to your ggplot, matplotlib, or seaborn plots. The aim is to ensure that plots maintain a uniform look, irrespective of whether they were made in R or Python.

2. BioLizard Color Palettes

These are qualitative, sequential, and divergent color maps that can be applied to your plots. The palettes are designed using BioLizard's house colors, keeping perceptual uniformity and color-blind friendliness in mind. For more information, consult the help documentation specific to each function.

3. Finalizing and Exporting Plots: finalise_lizardplot()

This function adds a BioLizard footer beneath your graph and exports it to a specified format such as PNG or PDF. The footer includes the BioLizard logo at the bottom right corner and leaves room for source text.

Contributing and Feedback

Contributions and feedback are very welcome and much appreciated.

To report issues or provide feedback, you can: