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

Skip to content

Conversation

@danzimmerman
Copy link
Contributor

@danzimmerman danzimmerman commented Jul 8, 2021

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
@anntzer
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)

@jklymak
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.

@danzimmerman
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
@timhoffm
Copy link
Member

I've squash-merged.

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

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.

4 participants