Skip to content

Commit

Permalink
simplified plt.subplots call
Browse files Browse the repository at this point in the history
  • Loading branch information
milcent committed Nov 3, 2020
1 parent 226bd81 commit bf735d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benford/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def plot_expected(df, digs, save_plot=None, save_kwargs=None):
"""
if digs in [1, 2, 3]:
y_max = (df.Expected.max() + (10 ** -(digs) / 3)) * 100
fig, ax = plt.subplots(figsize=(2 * (digs ** 2 + 5), 1.5 *
(digs ** 2 + 5)))
figsize = 2 * (digs ** 2 + 5), 1.5 * (digs ** 2 + 5)
elif digs == 22:
y_max = 13.
fig, ax = plt.subplots(figsize=(14, 10.5))
figsize = 14, 10.5
elif digs == -2:
y_max = 1.1
fig, ax = plt.subplots(figsize=(15, 8))
figsize = 15, 8
fig, ax = plt.subplots(figsize=figsize)
plt.title('Expected Benford Distributions', size='xx-large')
plt.xlabel(df.index.name, size='x-large')
plt.ylabel('Distribution (%)', size='x-large')
Expand Down

0 comments on commit bf735d9

Please sign in to comment.