import matplotlib.pyplot as plt
from contextlib import contextmanager
@contextmanager
def figsize_as(width, height):
original_figsize = plt.rcParams['figure.figsize']
try:
plt.rcParams['figure.figsize'] = [width, height]
yield
finally:
plt.rcParams['figure.figsize'] = original_figsize
# Example usage:
with figsize_as(4, 4):
fig, ax = plt.subplots()
ax.plot([0, 1], [0, 1])
plt.show()
Block or Report
Block or report UmarZein
Report abuse
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abusePopular repositories
-
audience_programming
audience_programming Publici think theprimeagen's vim-with-me is pretty cool
Rust 1
-
-
-
-
-
belajarAjaaah
belajarAjaaah PublicForked from Zentilax/belajarAjaaah
sedang_belajar_git_juga
Python
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.