Dark Matplotlib themes/styles

I was searching dark themes for Matplotlib and found these three. And put them here with examples so I can find them faster next time.

QB style

Website: github.com/quantumblacklabs/qbstyles

Install:

pip install qbstyles

Example code:

import matplotlib.pyplot as plt
from qbstyles import mpl_style

def plot(dark):
  mpl_style(dark)
    
  plt.plot([1, 3, 9, 5, 2, 1, 1], marker='o')
  plt.plot([4, 5, 5, 7, 9, 8, 6], marker='o')

  plt.show()

plot(dark=True)

ing-theme-matplotlib

Website: pypi.org/project/ing-theme-matplotlib/

Install:

pip install ing_theme_matplotlib

Example code:

import matplotlib.pyplot as plt
from ing_theme_matplotlib import mpl_style

def plot(dark):
  mpl_style(dark)
    
  plt.plot([1, 3, 9, 5, 2, 1, 1], marker='o')
  plt.plot([4, 5, 5, 7, 9, 8, 6], marker='o')

  plt.show()

plot(dark=True)

mplcyberpunk

Website: github.com/dhaitz/mplcyberpunk

Install:

pip install mplcyberpunk

Example code:

import matplotlib.pyplot as plt
import mplcyberpunk

def plot():
  plt.style.use("cyberpunk")
    
  plt.plot([1, 3, 9, 5, 2, 1, 1], marker='o')
  plt.plot([4, 5, 5, 7, 9, 8, 6], marker='o')

  mplcyberpunk.add_glow_effects()
  plt.show()

plot()
def plot_lines_glow():
  plt.style.use("cyberpunk")
    
  plt.plot([1, 3, 9, 5, 2, 1, 1], marker='o')
  plt.plot([4, 5, 5, 7, 9, 8, 6], marker='o')

  mplcyberpunk.make_lines_glow()
  plt.show()


def plot_underglow():
  plt.style.use("cyberpunk")
    
  plt.plot([1, 3, 9, 5, 2, 1, 1], marker='o')
  plt.plot([4, 5, 5, 7, 9, 8, 6], marker='o')

  mplcyberpunk.add_underglow()
  plt.show()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.