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.
This repository contains two key packages:
- BioLizardStyleR - An R package designed for ggplot2.
- BioLizardStylePython - A Python package designed for matplotlib, also compatible with seaborn.
Developed by Robbe Neirynck during an internship at BioLizard
For installation details, usage examples, and example workflows, please refer to the "In Action" files specific to each package. Most information below this point is general, but the "In Action" files contain specialized guidance. At the very bottom of this README you can also find the needed installation info.
Both packages have three main components:
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.
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.
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.
Before using these packages, install the NunitoSans fonts from the fontstoinstall
folder. NunitoSans is an open-license google-font that closely resembles BioLizard's house font, Avenir.
Contributions and feedback are very welcome and much appreciated.
To report issues or provide feedback, you can:
-
Open an issue on GitHub
-
Contact us via the following channels:
- Project Supervisor: [email protected]
- Slack: there is a (private) #nature-grade-visualisations channel. Let Alexander know if you'd like to be added!
Note: Only possible like this if the repo is public already
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}
devtools::install_github("lizard-bio/nature-grade-visualization-playground", subdir="BioLizardStyleR")
library(BioLizardStyleR)
install_biolizard_fonts()
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
.
The BioLizardStylePython package is available on PyPI and can be easily installed using:
pip install BioLizardStylePython
Common Issue
If matplotlib is previously installed, you might need to delete the existing local font cache of matplotlib for it to recognize the Nunito Sans font.
You can find the dir of the cache by running import matplotlib as mpl; print(mpl.get_cachedir())
.