Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add \underline to mathtext#15624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
wesbarnett wants to merge360 commits intomatplotlib:mainfromwesbarnett:underline
Closed

Conversation

wesbarnett
Copy link

@wesbarnettwesbarnett commentedNov 7, 2019
edited
Loading

PR Summary

Implements#14235 to add \underline to mathtext.

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

iago-lito and nicola-decao reacted with hooray emojiiago-lito reacted with heart emoji
@pprasha
Copy link

let me take a look

nicola-decao reacted with thumbs up emoji

@jklymakjklymak marked this pull request as draftJuly 23, 2020 03:22
anntzerand others added25 commitsSeptember 12, 2021 14:02
Make type lists fit in a single line.  A strict reading suggests thatall types should be separated with ` or ` rather than a comma, butavoiding a backslash continuation seems more useful.Also, *s* can also be a str.
Fix validate_markevery docstring markup.
This was introduced in 2015 when support for running nose tests via`setup.py test` was removed. We do not need to explicitly tell peopleanymore that this is not possible.
They are instead replaced by slightly roundabout ways to get hold of thesame objects (CompilerError, CCompiler).Only distutils.sysconfig remains; we should investigate whether thestdlib's sysconfig is a satisfactory replacement for it.
As noted in the module docstring, there is a confusion between using ageneric default MarkerStyle (empty) and the artist-specific one (e.g.scatter plots use `rcParams["scatter.marker"]`).  Fortunately, directconstruction of MarkerStyles (especially of empty ones) is hardly everneeded, so we can just make the parameter required.
…plateFix typo in template of current dev-docs
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
Deprecate support for no-args MarkerStyle().
As for other APIs, this is less likely to be confused with the Noneobject.
Unlike the Agg renderer, the Cairo renderer exists forever and is at theDPI when the figure was created. This needs to be updated before drawingor things in physical sizes (e.g., text or line widths) will be thewrong size.
Otherwise, `FigureCanvasBase.get_width_height` returns a size scaleddown by the current pixel ratio, even though the DPI is not scaled up.This causes the saved figure to be cropped.
set_dashes does not support offset=None anymore.
@wesbarnett
Copy link
Author

@QuLogic you can remove the "work in progress" tag for this. It's ready to be reviewed. Thanks!

@@ -2915,6 +2922,26 @@ def overline(self, s, loc, toks):
hlist = Hlist([rightside])
return [hlist]

def underline(self, s, loc, toks):
(body,), = toks
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for your perseverance with this. Is it possible the test coverage could hit these missing lines?

@jklymak
Copy link
Member

@wesbarnett popping to draft until the rebase gets figured out.... You may need to follow instructions athttps://discourse.matplotlib.org/t/default-branch-renamed-with-minor-edit-to-history/22367/2 Thanks!

@tfpf
Copy link
Contributor

There haven't been any updates here for a while. Unless I am mistaken, this is not extremely hard to implement. The details are in node 735 ofTeX, but it doesn't look that's what's happening here?

@tfpf
Copy link
Contributor

I think mimicking TeX's behaviour is straightforward. Not sure how exactlyoverline works, but TeX puts a space between the text and the underline equal to thrice the thickness of the underline (even if the text has depth). Just adding vertical kerning should work?

I can open another pull request to implement it if that's okay.

@timhoffm
Copy link
Member

I think mimicking TeX's behaviour is straightforward. Not sure how exactlyoverline works, but TeX puts a space between the text and the underline equal to thrice the thickness of the underline (even if the text has depth). Just adding vertical kerning should work?

I can open another pull request to implement it if that's okay.

I'm not a TeX expert, but if you have a straight-forward solution, please go ahead and open a new PR.

tfpf reacted with thumbs up emoji

@tfpftfpf mentioned this pull requestAug 14, 2022
5 tasks
@github-actions
Copy link

Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it.

@github-actionsgithub-actionsbot added the status: inactiveMarked by the “Stale” Github Action labelJun 30, 2023
@melissawm
Copy link
Member

It looks like there are two PRs trying to solve the same issue here - this one and#23616. Any chance@wesbarnett and@tfpf could team up or review each other's work so this feature can move forward? Thanks!

@rcomer
Copy link
Member

Looks like@tfpf opened the other PR because this one had stalled....

@tfpf
Copy link
Contributor

tfpf commentedJul 4, 2023

Initially, I though this approach could be improved by applying themake_under procedure of TeX (node 735 inTeX: the Program). To my utter surprise, wesbarnett's code (from here) and the TeX code (from#23616) produce the exact same images! Unless I have terribly messed something up, the PNG files are identical, byte for byte; the SVG files are also identical, at least visually.

w
w

import matplotlib.pyplot as pltfig = plt.figure()plt.text(.5, .5, r'$\underline{ul}$', size=50)plt.axhline(.5)plt.savefig('s.svg')plt.savefig('p.png')plt.show()

Note that the SVG and PNG backends render the image differently. I got stuck here, and documented it in#23763. Still unable to figure out whythat happens.

@wesbarnett
Copy link
Author

My PR is so far off withmain at this point, I'm happy to close this as a duplicate of#23616. (My implementation was basically copying the overline functionality and making a few adjustments for it to be used as an underline.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak left review comments

Assignees
No one assigned
Projects
Status: Waiting for author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

22 participants
@wesbarnett@pprasha@jklymak@tfpf@timhoffm@melissawm@rcomer@QuLogic@story645@anntzer@dstansby@deep-jkl@jyjoshi@tacaswell@fariza@beckja@greglucas@pijyoi@MalikIdreesHasanKhan@fishmandev@isha614@liamtoney

[8]ページ先頭

©2009-2025 Movatter.jp