1 hidden cell
Envidan, a color guide for matplotlib and seaborn
Background
Envidan (Invalid URL) is a Scandinavian company in strong growth with offices in Denmark, Sweden and Norway. We provide holistic solutions for the water, waste water, energy and environmental sectors, as well as financial advice and a wide range of software solutions for our Danish, Norwegian and Swedish clients.
Envidan has changed its design for a new font (Satoshi) and 6 colurs in 4 different shades. Since we work with datascience and use data visualization, this guide has been created to fully implement this new design in our data visualizations.
The author of this notebook is employed by Envidan, but this guide is entirely a private project.
I have created a package named "ed_design" which holds the design colors with palettes and colormaps bases on these design colors.
Install ed_design
pip install ed_design
# Installing ed_design, version 1.0.7 for specifc version for this notebook. Just use pip install ed_design for your environment to get the latest version
!pip install ed_design==1.0.7Import of ed_design
When importing ed_design a check is forced if your system has two fonts installed; "Satoshi" and "Segou UI" and the different styles of these two. If not you will be given a warning in the form of a printed message to the console informing you that you need to install these fonts if you want matplotlib to use them. I dont know how to install fonts by python code on different systems so this you need to do manually.
# Import of ed_design
import ed_design as edd  # Forcing font check - and for some reason this check is not performed in this workbook - dont know why# Font check manually
edd.font_check()# Font check specific
edd.font_check('my_font_name_to_check')# This font should be present on this system and will not be reported
edd.font_check('Times')Style
The package holds a matplotlib style sheet named "envidan" that can be activated to use the design Envidan uses for datascience styles, including fonts. The style includes setting a prop_cycle_palette for the colors where the standard is the "normal" palette of ed_design. Different palettes are discussed later.
# Revert back to Matplotlib default style
edd.style(style='default')# Setting Envidan style for Matplotlib
edd.style()
# Standard input, same as above
edd.style(style='envidan', prop_cycle_palette='normal') Envidan logo
The Envidan logo can be loaded in an array with
logo = edd.logo()
There are two logos. "print" and "web". The "print" version is the standard. Simply use
logo = edd.logo('web')
for the "web" version
Colors
the pypi package ed_design contains a class Colors. This class contains dictionaries of the base colors and some standard palettes.
- self.colors
- dictionary with the colorgroups: "blues", "greens", "reds", "yellows", "browns" and "purples" in HEX format
 
- self.palettes
- dictionary with palettes based on the colorgroups
 
- self.colormaps
- dictionary with diverging colormaps based on two colors
 
There are several class methods to get and create palettes and colormaps which will be described below.
Design color, palettes, colormaps
First we instanciate the Color class together with other modules and the Envidan logo.