Skip to content

Instantly share code, notes, and snippets.

@NISH1001
Last active November 14, 2018 08:04
Show Gist options
  • Save NISH1001/9ebd87cd0f3a587c63fd9dfdf16f2ba1 to your computer and use it in GitHub Desktop.
Save NISH1001/9ebd87cd0f3a587c63fd9dfdf16f2ba1 to your computer and use it in GitHub Desktop.
matplotlib configuration tutorial

Change backend from Code

import matplotlib

# first check which backend
maplotlib.get_backend()

# change
matplotlib.rcParams['backend'] = 'GTK3Agg'

Use configuration file

  • Create a config file at ~/.config/matplotlib/matplotlibrc
  • In this file set the value of backend as:
backend: GTK3Agg

If that doesn't work

Just use agg as the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment