Skip to content

Matplotlib colormaps for the Uppsala Social Robotics Lab

Notifications You must be signed in to change notification settings

usr-lab/usrl-colormaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USRL Colormaps

This repository contains a collection of colormaps that are useful when generating figures for presentations or papers by the Uppsala Social Robotics Lab. Available colormaps:

Showcase of available colormaps

Installation

pip install usrl-colormaps

Usage

Inside of matplotlib:

import matplotlib.pyplot as plt
import matplotlib.cm as cm
import usrl_colormaps  # colormaps are registered automatically

fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
langs = ['C', 'C++', 'Java', 'Python', 'PHP']
students = [23,17,35,29,12]
ax.bar(langs,students, color=cm.get_cmap("usr_qualitative").colors)
ax.grid(False)
plt.show()

Matplotlib example plot

In seaborn:

import seaborn as sns
import usrl_colormaps  # colormaps are registered automatically


sns.set_theme(style="whitegrid")
diamonds = sns.load_dataset("diamonds")

# Plot the distribution of clarity ratings, conditional on carat
sns.displot(
    data=diamonds,
    x="carat", hue="cut",
    kind="kde", height=6,
    multiple="fill", clip=(0, None),
    palette="usr_oranges",
)

Seaborn example plot

About

Matplotlib colormaps for the Uppsala Social Robotics Lab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages