Skip to content

Commit

Permalink
use defaults for sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Jul 18, 2023
1 parent d12670b commit 5d35f9e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions fooof/plts/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from fooof.core.modutils import safe_import, check_dependency
from fooof.plts.utils import check_ax, set_alpha
from fooof.plts.settings import TITLE_FONTSIZE, LABEL_SIZE, TICK_LABELSIZE

plt = safe_import('.pyplot', 'matplotlib')

Expand Down Expand Up @@ -46,14 +47,14 @@ def plot_scatter_1(data, label=None, title=None, x_val=0, ax=None):
ax.scatter(x_data, data, s=36, alpha=set_alpha(len(data)))

if label:
ax.set_ylabel(label, fontsize=16)
ax.set_ylabel(label, fontsize=LABEL_SIZE)
ax.set(xticks=[x_val], xticklabels=[label])

if title:
ax.set_title(title, fontsize=20)
ax.set_title(title, fontsize=TITLE_FONTSIZE)

ax.tick_params(axis='x', labelsize=16)
ax.tick_params(axis='y', labelsize=12)
ax.tick_params(axis='x', labelsize=TICK_LABELSIZE)
ax.tick_params(axis='y', labelsize=TICK_LABELSIZE)

ax.set_xlim([-0.5, 0.5])

Expand Down Expand Up @@ -89,12 +90,12 @@ def plot_scatter_2(data_0, label_0, data_1, label_1, title=None, ax=None):
plot_scatter_1(data_1, label_1, x_val=1, ax=ax1)

if title:
ax.set_title(title, fontsize=20)
ax.set_title(title, fontsize=TITLE_FONTSIZE)

ax.set(xlim=[-0.5, 1.5],
xticks=[0, 1],
xticklabels=[label_0, label_1])
ax.tick_params(axis='x', labelsize=16)
ax.tick_params(axis='x', labelsize=TICK_LABELSIZE)


@check_dependency(plt, 'matplotlib')
Expand All @@ -121,13 +122,13 @@ def plot_hist(data, label, title=None, n_bins=25, x_lims=None, ax=None):

ax.hist(data[~np.isnan(data)], n_bins, range=x_lims, alpha=0.8)

ax.set_xlabel(label, fontsize=16)
ax.set_ylabel('Count', fontsize=16)
ax.set_xlabel(label, fontsize=LABEL_SIZE)
ax.set_ylabel('Count', fontsize=LABEL_SIZE)

if x_lims:
ax.set_xlim(x_lims)

if title:
ax.set_title(title, fontsize=20)
ax.set_title(title, fontsize=TITLE_FONTSIZE)

ax.tick_params(axis='both', labelsize=12)
ax.tick_params(axis='both', labelsize=TICK_LABELSIZE)

0 comments on commit 5d35f9e

Please sign in to comment.