Skip to content

Commit

Permalink
Customizable figure size (#222)
Browse files Browse the repository at this point in the history
Currently, there is no easy way to change figure sizes when using high-level visualization functions
such as `plot_problem`.
Generally, I'd prefer controlling plotting through matplotlib's `rcParams`, but this change provides
at least some backwards-compatible means of changing figure sizes at a higher level by, e.g.
`petab.visualize.plotting.DEFAULT_FIGSIZE = (8, 4)`.
  • Loading branch information
dweindl committed Sep 17, 2023
1 parent 52d8ab1 commit 304f953
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion petab/visualize/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
IdsList = List[str]
NumList = List[int]

# The default figure size
DEFAULT_FIGSIZE = (20, 15)

# also for type hints
# TODO: split into dataplot and subplot level dicts?
Expand Down Expand Up @@ -262,7 +264,7 @@ class Figure:
Contains information regarding how data should be visualized.
"""
def __init__(self, subplots: Optional[List[Subplot]] = None,
size: Tuple = (20, 15),
size: Tuple = DEFAULT_FIGSIZE,
title: Optional[Tuple] = None):
"""
Constructor.
Expand Down

0 comments on commit 304f953

Please sign in to comment.