Skip to content

Commit

Permalink
Reduce complexity of plot_histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnh committed Feb 9, 2022
1 parent 17fc535 commit 31341eb
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions litstudy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ def plot_histogram(
else:
label_rotation = 0

if title:
ax.set_title(title)

if not ylabel:
if relative_to is not None:
ylabel = '% of documents'
Expand All @@ -92,20 +89,18 @@ def plot_histogram(

if not vertical:
ax.grid(b=False, which='both', axis='y')

if xlabel:
ax.set_ylabel(xlabel)

if ylabel:
ax.set_xlabel(ylabel)
xlabel, ylabel = ylabel, xlabel
else:
ax.grid(b=False, which='both', axis='x')

if xlabel:
ax.set_xlabel(xlabel)
if title:
ax.set_title(title)

if xlabel:
ax.set_xlabel(xlabel)

if ylabel:
ax.set_ylabel(ylabel)
if ylabel:
ax.set_ylabel(ylabel)

if keys is None:
keys = list(data.index)
Expand Down

0 comments on commit 31341eb

Please sign in to comment.