
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How can I set the 'backend' in matplotlib in Python?
We can use matplotlib.rcParams['backend'] to override the backend value.
Steps
Using get_backend() method, return the name of the current backend, i.e., default name.
Now override the backend name.
Using get_backend() method, return the name of the current backend, i.e., updated name.
Example
import matplotlib print("Before, Backend used by matplotlib is: ", matplotlib.get_backend()) matplotlib.rcParams['backend'] = 'TkAgg' print("After, Backend used by matplotlib is: ", matplotlib.get_backend())
Output
Before, Backend used by matplotlib is: GTK3Agg After, Backend used by matplotlib is: TkAgg
- Related Articles
- How do I configure the behavior of the Qt4Agg backend in Matplotlib?
- How can I set the location of minor ticks in Matplotlib?
- How can I plot a single point in Matplotlib Python?
- How can I render 3D histograms in Python using Matplotlib?
- How can I manually set proxy settings in Python Selenium?
- How can I hide the axes in Matplotlib 3D?
- How do I set color to Rectangle in Matplotlib?
- How can I show figures separately in Matplotlib?
- How can I plot hysteresis threshold in Matplotlib?
- Matplotlib Backend Differences between Agg and Cairo
- How to check that pylab backend of Matplotlib runs inline?
- How can I draw inline line labels in Matplotlib?
- How can I cycle through line styles in Matplotlib?
- How can I plot a confusion matrix in matplotlib?
- How can I view the indexes I have set up in MySQL?

Advertisements