Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add overset/underset whatsnew entry #19497

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 11, 2021
Merged

Conversation

aitikgupta
Copy link
Contributor

@aitikgupta aitikgupta commented Feb 11, 2021

PR Summary

This is a continuation of the previous PR #18916,
w.r.t. this comment: #18916 (comment)

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • 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).

Comment on lines 4 to 9
`.mathtext`, the default TeX layout engine which is shipped along with
Matplotlib now supports symbols like *overset* and *underset*.

The structure which should be followed: "\overset{body}{annotation}" or
"\underset{body}{annotation}", where *body* would be the text "above" or
"below" the *annotation* - the baseline character.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`.mathtext`, the default TeX layout engine which is shipped along with
Matplotlib now supports symbols like *overset* and *underset*.
The structure which should be followed: "\overset{body}{annotation}" or
"\underset{body}{annotation}", where *body* would be the text "above" or
"below" the *annotation* - the baseline character.
`.mathtext` now supports *overset* and *underset*, called as
``\overset{body}{annotation}`` or ``\underset{body}{annotation}``, where
*annotation* is the text "above" or "below" the *body*.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Suggest more direct language. Also I think your transposed "body" and "annotation"

@jklymak jklymak added this to the v3.4.0 milestone Feb 11, 2021
@aitikgupta
Copy link
Contributor Author

Suggest more direct language.

👍🏼

Also I think your transposed "body" and "annotation"

body is supposed to be the text that goes above or below the annotation, see #18916 (comment)
Also this:

if overunder == "under":
vlist = Vlist([cannotation, # annotation
Vbox(0, vgap), # space
cbody # body
])

@anntzer
Copy link
Contributor

anntzer commented Feb 11, 2021

I guess I didn't pay attention in my original review; certainly "body" should be the main thing and "annotation" the out-of-alignment extra thing.

@jklymak
Copy link
Member

jklymak commented Feb 11, 2021

Suggest more direct language.

👍🏼

Also I think your transposed "body" and "annotation"

body is supposed to be the text that goes above or below the annotation, see #18916 (comment)
Also this:

if overunder == "under":
vlist = Vlist([cannotation, # annotation
Vbox(0, vgap), # space
cbody # body
])

OK, that is super confusing. In \overset{\Delta x\to 0}{\longrightarrow} I'd have said \Delta x \to 0 is an annotation on \longrightarrow.

Ooops, crosspost with above.

@aitikgupta
Copy link
Contributor Author

I can clean the logic up in this PR
Initially even I was confused as to what annotation and body would be 😬

---------------------------------------------------------------------------

`.mathtext` now supports *overset* and *underset*, called as
``\overset{body}{annotation}`` or ``\underset{body}{annotation}``, where
Copy link
Member

Choose a reason for hiding this comment

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

OK, but now this is wrong again, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I blindly copied the suggestion, let me fix that

@anntzer anntzer merged commit 92b4bc3 into matplotlib:master Feb 11, 2021
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.

3 participants