
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maximize PLT Show Using Python on Mac
To maximize plt.show() using Python on Mac, we can use full_screen_toggle().
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Add a subplot to the current figure.
- Make a piechart with input list.
- Get the Figure Manager of the current figure.
- Use full_screen_toggle() to create a full-screen pop-up window.
- To display the figure, use show() method.
Example
import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True plt.subplot(1, 1, 1) plt.pie([1, 2, 3]) mng = plt.get_current_fig_manager() mng.full_screen_toggle() plt.show()
Output
Advertisements