From c8b3eac33238f9aa4498d7a2e19b1b730ac292e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Aug 2020 20:01:25 +0200 Subject: [PATCH 1/3] cap target ymax --- dufte/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dufte/main.py b/dufte/main.py index edb5273..91218f8 100644 --- a/dufte/main.py +++ b/dufte/main.py @@ -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] From b0a56ccc09ffa93cdf2bf7136faf2eaafa837669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Aug 2020 20:01:34 +0200 Subject: [PATCH 2/3] version bump --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0753b7a..ee36da8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 From c43403bc14376941911d5795333611271e1704b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Aug 2020 20:02:02 +0200 Subject: [PATCH 3/3] gh update --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1311354..4ab3e58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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