Monochromatic colorscheme for matplotlib with opinionated sensible default

Overview

Monochromatic colorscheme for matplotlib with opinionated sensible default

If you need a simple monochromatic colorscheme for your matplotlib figures, this is probably for you. No fancy colors and unnecessary distractions.

To install, simply run this on terminal:

pip install monoplt

or if you want the latest development version, run this instead:

pip install git+https://github.com/ariaghora/monoplt

Usage

from monoplt import apply_monochrome_style, generate_pattern_cycler
import matplotlib.pyplot as plt
apply_monochrome_style(plt)

Example: line plot

plt.figure(figsize=(7,5))
for i in range(1,5):
    plt.plot(np.arange(10), np.arange(10)*i, label=i)
plt.xlabel("$x$")
plt.ylabel("$f(x)$")
plt.legend(facecolor='white', framealpha=1)
plt.show()

line

Example: bar plot

For plots involving fill colors (e.g., bar plot, histogram, etc.), this will give you some trouble since all colors are black, and no distinction between plotted groups. To mitigate this issue, we can use generate_pattern_cycler() to get a cycler of fill patterns that characterize each group.

styles = generate_pattern_cycler()

plt.figure(figsize=(7, 5))
for x in range(1,5):
    plt.bar(x, np.random.randint(2,10), label=f"Bar {x}", **next(styles))
plt.xlabel("Category")
plt.ylabel("Amount")
plt.show()

line

Example: histogram

styles = generate_pattern_cycler()
plt.figure(figsize=(7, 5))
x = np.random.randn(1000)
plt.hist(x, bins=30, density=True, **next(styles))
plt.xlabel("$x$")
plt.ylabel("$f(x)$")
plt.show()

line

Example: pie

plt.figure(figsize=(7, 5))
pie = plt.pie(
    [2, 3, 1, 5, 7, 9], 
    labels=["two", "three", "one", "five", "seven", "nine"],
)

styles = generate_pattern_cycler()
for part in pie[0]:
    part.set(**next(styles))

line

Heavily adopted from Olsgaard's post

Owner
Aria Ghora Prabono
Researcher | Coder
Aria Ghora Prabono
3D Vision functions with end-to-end support for deep learning developers, written in Ivy.

Ivy vision focuses predominantly on 3D vision, with functions for camera geometry, image projections, co-ordinate frame transformations, forward warping, inverse warping, optical flow, depth triangul

Ivy 61 Dec 29, 2022
Voilà, install macOS on ANY Computer! This is really and magic easiest way!

OSX-PROXMOX - Run macOS on ANY Computer - AMD & Intel Install Proxmox VE v7.02 - Next, Next & Finish (NNF). Open Proxmox Web Console - Datacenter N

Gabriel Luchina 654 Jan 09, 2023
Official Matplotlib cheat sheets

Official Matplotlib cheat sheets

Matplotlib Developers 6.7k Jan 09, 2023
A collection of 100 Deep Learning images and visualizations

A collection of Deep Learning images and visualizations. The project has been developed by the AI Summer team and currently contains almost 100 images.

AI Summer 65 Sep 12, 2022
This is my favourite function - the Rastrigin function.

This is my favourite function - the Rastrigin function. What sparked my curiosity and interest in the function was its complexity in terms of many local optimum points, which makes it particularly in

1 Dec 27, 2021
a simple REPL display lib for circuitpython

Circuitpython-termio-lib a simple REPL display lib for circuitpython Fonctions cls clear terminal screen and set cursor on top left : coords 0,0 usage

BeBoXoS 1 Nov 17, 2021
Rubrix is a free and open-source tool for exploring and iterating on data for artificial intelligence projects.

Open-source tool for exploring, labeling, and monitoring data for AI projects

Recognai 1.5k Jan 07, 2023
Sprint planner considering JIRA issues and google calendar meetings schedule.

Sprint planner Sprint planner is a Python script for planning your Jira tasks based on your calendar availability. Installation Use the package manage

Apptension 2 Dec 05, 2021
Easily convert matplotlib plots from Python into interactive Leaflet web maps.

mplleaflet mplleaflet is a Python library that converts a matplotlib plot into a webpage containing a pannable, zoomable Leaflet map. It can also embe

Jacob Wasserman 502 Dec 28, 2022
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

HoloViz 697 Jan 06, 2023
Simple function to plot multiple barplots in the same figure.

Simple function to plot multiple barplots in the same figure. Supports padding and custom color.

Matthias Jakobs 2 Feb 21, 2022
A curated list of awesome Dash (plotly) resources

Awesome Dash A curated list of awesome Dash (plotly) resources Dash is a productive Python framework for building web applications. Written on top of

Luke Singham 1.7k Jan 07, 2023
WhatsApp Chat Analyzer is a WebApp and it can be used by anyone to analyze their chat. 😄

WhatsApp-Chat-Analyzer You can view the working project here. WhatsApp chat Analyzer is a WebApp where anyone either tech or non-tech person can analy

Prem Chandra Singh 26 Nov 02, 2022
Script to create an animated data visualisation for categorical timeseries data - GIF choropleth map with annotations.

choropleth_ldn Simple script to create a chloropleth map of London with categorical timeseries data. The script in main.py creates a gif of the most f

1 Oct 07, 2021
Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Karl Jaehnig 7 Oct 22, 2022
A D3.js plugin that produces flame graphs from hierarchical data.

d3-flame-graph A D3.js plugin that produces flame graphs from hierarchical data. If you don't know what flame graphs are, check Brendan Gregg's post.

Martin Spier 740 Dec 29, 2022
matplotlib: plotting with Python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Check out our home page for more inform

Matplotlib Developers 16.7k Jan 08, 2023
A python package for animating plots build on matplotlib.

animatplot A python package for making interactive as well as animated plots with matplotlib. Requires Python = 3.5 Matplotlib = 2.2 (because slider

Tyler Makaro 394 Dec 18, 2022
A simple project on Data Visualization for CSCI-40 course.

Simple-Data-Visualization A simple project on Data Visualization for CSCI-40 course - the instructions can be found here SAT results in New York in 20

Hugo Matousek 8 Oct 27, 2021
Show Data: Show your dataset in web browser!

Show Data is to generate html tables for large scale image dataset, especially for the dataset in remote server. It provides some useful commond line tools and fully customizeble API reference to gen

Dechao Meng 83 Nov 26, 2022