From c407798c581b50288a37ad0ecfeba381916935b2 Mon Sep 17 00:00:00 2001 From: kkoutris Date: Mon, 2 May 2022 15:38:10 +0300 Subject: [PATCH 1/3] Fix example "Scale invariant angle label" --- examples/text_labels_and_annotations/angle_annotation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/text_labels_and_annotations/angle_annotation.py b/examples/text_labels_and_annotations/angle_annotation.py index 8272dd1f3e06..c00689f09cfa 100644 --- a/examples/text_labels_and_annotations/angle_annotation.py +++ b/examples/text_labels_and_annotations/angle_annotation.py @@ -185,7 +185,7 @@ def update_text(self): r = s / 2 if self.textposition == "inside": r = s / np.interp(angle_span, [60, 90, 135, 180], - [3.3, 3.5, 3.8, 4]) + [10, 3.5, 11.4, 4]) self.text.xy = c + r * np.array([np.cos(angle), np.sin(angle)]) if self.textposition == "outside": def R90(a, r, w, h): From 7dafd2db444b7b41363850f5afd545d76525e674 Mon Sep 17 00:00:00 2001 From: kkoutris Date: Mon, 9 May 2022 23:58:30 +0300 Subject: [PATCH 2/3] Fix example "Scale invariant angle label" --- .../text_labels_and_annotations/angle_annotation.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/text_labels_and_annotations/angle_annotation.py b/examples/text_labels_and_annotations/angle_annotation.py index c00689f09cfa..cce7a6876e9e 100644 --- a/examples/text_labels_and_annotations/angle_annotation.py +++ b/examples/text_labels_and_annotations/angle_annotation.py @@ -237,10 +237,14 @@ def R(a, r, w, h): line2, = ax.plot(*zip(*p2)) point, = ax.plot(*center, marker="o") -am1 = AngleAnnotation(center, p1[1], p2[1], ax=ax, size=75, text=r"$\alpha$") -am2 = AngleAnnotation(center, p2[1], p1[0], ax=ax, size=35, text=r"$\beta$") -am3 = AngleAnnotation(center, p1[0], p2[0], ax=ax, size=75, text=r"$\gamma$") -am4 = AngleAnnotation(center, p2[0], p1[1], ax=ax, size=35, text=r"$\theta$") +am1 = AngleAnnotation(center, p1[1], p2[1], ax=ax, size=75, textposition="inside", + text=r"$\alpha$") +am2 = AngleAnnotation(center, p2[1], p1[0], ax=ax, size=35, textposition="inside", + text=r"$\beta$") +am3 = AngleAnnotation(center, p1[0], p2[0], ax=ax, size=75, textposition="inside", + text=r"$\gamma$") +am4 = AngleAnnotation(center, p2[0], p1[1], ax=ax, size=35, textposition="inside", + text=r"$\theta$") # Showcase some styling options for the angle arc, as well as the text. From d57af62d399a990126b84d4acb018077d16c037d Mon Sep 17 00:00:00 2001 From: kkoutris Date: Tue, 10 May 2022 11:37:55 +0300 Subject: [PATCH 3/3] Fix code to be on par with flake --- .../angle_annotation.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/text_labels_and_annotations/angle_annotation.py b/examples/text_labels_and_annotations/angle_annotation.py index cce7a6876e9e..9021a092292b 100644 --- a/examples/text_labels_and_annotations/angle_annotation.py +++ b/examples/text_labels_and_annotations/angle_annotation.py @@ -237,14 +237,14 @@ def R(a, r, w, h): line2, = ax.plot(*zip(*p2)) point, = ax.plot(*center, marker="o") -am1 = AngleAnnotation(center, p1[1], p2[1], ax=ax, size=75, textposition="inside", - text=r"$\alpha$") -am2 = AngleAnnotation(center, p2[1], p1[0], ax=ax, size=35, textposition="inside", - text=r"$\beta$") -am3 = AngleAnnotation(center, p1[0], p2[0], ax=ax, size=75, textposition="inside", - text=r"$\gamma$") -am4 = AngleAnnotation(center, p2[0], p1[1], ax=ax, size=35, textposition="inside", - text=r"$\theta$") +am1 = AngleAnnotation(center, p1[1], p2[1], ax=ax, size=75, + textposition="inside", text=r"$\alpha$") +am2 = AngleAnnotation(center, p2[1], p1[0], ax=ax, size=35, + textposition="inside", text=r"$\beta$") +am3 = AngleAnnotation(center, p1[0], p2[0], ax=ax, size=75, + textposition="inside", text=r"$\gamma$") +am4 = AngleAnnotation(center, p2[0], p1[1], ax=ax, size=35, + textposition="inside", text=r"$\theta$") # Showcase some styling options for the angle arc, as well as the text.