- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Plot width settings in ipython notebook
Using plt.rcParams["figure.figsize"], we can get the width setting.
Steps
To get the plot width setting, use plt.rcParams["figure.figsize"] statement.
Override the plt.rcParams["figure.figsize"] with a tuple (12, 9).
After updating the width, get the updated width using plt.rcParams["figure.figsize"].
Examples
In IDE
Example
import matplotlib.pyplot as plt print("Before, plot width setting:", plt.rcParams["figure.figsize"]) plt.rcParams["figure.figsize"] = (12, 9) print("Before, plot width setting:", plt.rcParams["figure.figsize"])
Output
Before, plot width setting: [6.4, 4.8] Before, plot width setting: [12.0, 9.0]
In IPython
Example
In [1]: from matplotlib import pyplot as plt In [2]: plt.rcParams["figure.figsize"]
Output
Out[2]: [6.4, 4.8]
Advertisements