FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix example for "Scale invariant angle label" by kkoutris · Pull Request #23027 · matplotlib/matplotlib · GitHub

Repository navigation

Fix example for "Scale invariant angle label" - #23027

Closed
kkoutris wants to merge 3 commits into
matplotlib:mainfrom
kkoutris:kkoutris
Closed

kkoutris wants to merge 3 commits into
matplotlib:mainfrom
kkoutris:kkoutris

Conversation

kkoutris commented May 9, 2022 •
edited
Loading

Copy link
Copy Markdown

PR Summary

Fix the plot example so that the letters be inside the arcs.

Closes #22392

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

kkoutris changed the title Kkoutris Fix example for "Scale invariant angle label" May 9, 2022

kkoutris commented May 9, 2022

Copy link
Copy Markdown
Author

#22392

andrew-fennell commented May 9, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

Hi there, @kkoutris! Thanks for looking into this issue.

It looks like you have a few linting issues being caught by flake8. Pre-commit hooks check this, but you can also use flake8 <file path to lint> to check for linting issues.

Copy link
Copy Markdown
Member

I took the liberty of adding "Closes ..." to the original post. In that way the issue is automatically closed upon merge.

andrew-fennell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think a different approach is needed to solve this issue.

I added a comment that might offer more insight here: #22392 (comment)

Comment on lines +240 to +247
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$")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

textposition="inside" is the default for the AngleAnnotation class.

This can be found here:

text="", textposition="inside", text_kw=None, **kwargs):

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])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not sure this is the right approach to fix the issue. This is moving the text, but the issue is really about the scaling of the angle markings.

jklymak marked this pull request as draft June 2, 2022 12:24

jklymak commented Jun 2, 2022

Copy link
Copy Markdown
Member

Moved to draft until comments addressed. Thanks!

timhoffm commented Feb 2, 2025

Copy link
Copy Markdown
Member

Closing as this is not the right approach (see #23027 (review)).

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc]: Example for "Scale invariant angle label" does not scale the arc correctly

5 participants


Back | FazBrowse Home | New Git URL