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 \dddot and \ddddot as accents in mathtext #20605

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
timhoffm merged 6 commits into matplotlib:master from danzimmerman:three-four-dot-accents
Jul 10, 2021

Conversation

Copy link
Contributor

@danzimmerman danzimmerman commented Jul 8, 2021
edited
Loading

PR Summary

This is an experiment to address and discuss #20595

Note that dddot and ddddot were already defined as 8411 and 8412 in tex2uni in _mathtext_data.py, I added them again as combiningthreedotsabove and combiningfourdotsabove.

This PR also added a --keep-going flag in make.bat so I could build the documentation on Windows. I should probably raise that in a separate issue/PR.

Before, Mathtext Mode
dddot_before

After, Mathtext Mode
dddot_after

LaTeX vs. Mathtext Tests

With the right packages included, this works fine with usetex=True:

import matplotlib.pyplot as plt
import matplotlib as mpl
plt.rc('text.latex', preamble=r'\usepackage{amsmath}\usepackage{amssymb}')
fig = plt.figure(figsize=(15, 9), dpi=200)
ax = fig.subplots(1, 1)
fs = 80
pstra = r'$\dot{x}\hspace{1.5}\ddot{x}\hspace{1.5}\dddot{x}\hspace{1.5}\ddddot{x}$'
pstratex = r'$\dot{x}\hspace{1.5em}\ddot{x}\hspace{1.5em}\dddot{x}\hspace{1.5em}\ddddot{x}$'
ax.annotate(pstra, xy=(0.1, 0.1), fontsize=fs)
ax.annotate(pstratex, xy=(0.1, 0.5), fontsize=fs, usetex=True)
ax.plot([0, 1], [0.591]*2, linewidth=0.5)
ax.plot([0, 1], [0.221]*2, linewidth=0.5)
ax.set_ylim([-0.1, 1])
ax.set_xlim([0, 1])
fig.tight_layout()

usetex=True on the top, Mathtext mode on the bottom:

image

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • [N/A] Is Flake 8 compliant (many warnings on originals)
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [N/A] 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).

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@danzimmerman danzimmerman marked this pull request as ready for review July 9, 2021 01:53
Copy link
Contributor

anntzer commented Jul 9, 2021

Can you squash the commits (possibly splitting out the --keep-going patch)? Otherwise looks good to me, can be merged after CI completes and squashing (or not) is decided.

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

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

(see above)

Copy link
Member

jklymak commented Jul 9, 2021

@danzimmerman if you are not comfortable squashing (though I imagine you are given the technical needs of this change), let us know and we can just squash merge on our end.

Copy link
Contributor Author

@danzimmerman if you are not comfortable squashing (though I imagine you are given the technical needs of this change), let us know and we can just squash merge on our end.

@jklymak I'm not so familiar with squashing commits, and it looks like I complicated things by updating my branch from master while I was working (in my history now there are many interleaved commits).

I reverted the --keep-going in make.bat. If it's easy to squash merge it, please go ahead!

@timhoffm timhoffm added this to the v3.5.0 milestone Jul 10, 2021
@timhoffm timhoffm merged commit 0dd603f into matplotlib:master Jul 10, 2021
Copy link
Member

I've squash-merged.

Thanks @danzimmerman and congratulations on your first contribution to Matplotlib! Hope to see you again.

danzimmerman reacted with hooray emoji

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

@github-actions github-actions[bot] github-actions[bot] left review comments

@anntzer anntzer anntzer approved these changes

@timhoffm timhoffm timhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.5.0
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /