Skip to content

Commit

Permalink
update fig sizes and linewidths a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed Jul 22, 2023
1 parent 9e94b8b commit fb7f004
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 61 deletions.
8 changes: 4 additions & 4 deletions doc/examples/example01_indices.ipynb

Large diffs are not rendered by default.

40 changes: 24 additions & 16 deletions doc/examples/example02_distributions.ipynb

Large diffs are not rendered by default.

61 changes: 35 additions & 26 deletions doc/examples/example03_drought_NL.ipynb

Large diffs are not rendered by default.

63 changes: 54 additions & 9 deletions doc/examples/example04_package_comparison.ipynb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/spei/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def si(
si: Series, bound: float = 3.0, figsize: tuple = (8, 4), ax: Optional[Axes] = None
si: Series, bound: float = 3.0, figsize: tuple = (6.5, 4), ax: Optional[Axes] = None
) -> Axes:
"""Plot the standardized index values as a time series.
Expand All @@ -35,8 +35,8 @@ def si(
if ax is None:
_, ax = plt.subplots(figsize=figsize)

ax.plot(si, color="k", label="SGI")
ax.axhline(0, linestyle="--", color="k")
ax.plot(si.index, si.values, linewidth=1.0, color="k")
ax.axhline(0, linestyle="--", linewidth=1.0, color="k")

nmin = -bound
nmax = bound
Expand All @@ -62,7 +62,7 @@ def dist(
cumulative: bool = False,
test_dist: bool = True,
cmap: Optional[str] = None,
figsize: tuple = (8, 10),
figsize: tuple = (6.5, 10),
legend: bool = True,
) -> NDArrayAxes:
"""Plot the (cumulative) histogram and scipy fitted distribution
Expand Down Expand Up @@ -146,7 +146,7 @@ def dist(
ax.set_ylabel("Probability Density")
ax.set_title(month_name[i])
if legend:
ax.legend()
ax.legend(fontsize=7)

return axs

Expand Down Expand Up @@ -183,7 +183,7 @@ def monthly_density(
index = validate_index(si.index)

if ax is None:
_, ax = plt.subplots(figsize=(6, 4))
_, ax = plt.subplots(figsize=(6.5, 4))

cm = plt.get_cmap(cmap, 20)
colors = reshape(array([cm(x) for x in range(20)], dtype="f,f,f,f"), (5, 4))
Expand Down

0 comments on commit fb7f004

Please sign in to comment.