Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Small fix #17

Merged
merged 3 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- uses: actions/checkout@v2
Expand All @@ -25,7 +25,7 @@ jobs:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
Expand Down
7 changes: 7 additions & 0 deletions dufte/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def legend(ax=None, min_label_distance="auto", alpha=1.0):
targets = [line.get_ydata()[-1] for line in lines]
if logy:
targets = [math.log10(t) for t in targets]

# Sometimes, the max value if beyond ymax. It'd be cool if in this case we could put
# the label above the graph (instead of the to the right), but for now let's just
# cap the target y.
ymax = ax.get_ylim()[1]
targets = [min(target, ymax) for target in targets]

targets = _move_min_distance(targets, min_label_distance)
if logy:
targets = [10 ** t for t in targets]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dufte
version = 0.2.8
version = 0.2.9
author = Nico Schlömer
author_email = nico.schloemer@gmail.com
description = Clean matplotlib plots
Expand Down