-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
merged the tex_X.py files into a single file tex.py #8199
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
Conversation
examples/pylab_examples/tex.py
Outdated
plt.plot(t, s) | ||
|
||
plt.xlabel(r'\textbf{time (s)}') | ||
plt.ylabel('\\textit{Velocity (\u00B0/sec)}', fontsize=16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the named entity (\N{DEGREE SIGN}
is much clearer...)
examples/pylab_examples/tex.py
Outdated
|
||
|
||
|
||
plt.figure(2, figsize=(6, 4)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you merge the two figures together? (e.g. two axes)
ax.plot(t, s) | ||
|
||
ax.set_xlabel(r'\textbf{time (s)}') | ||
ax.set_ylabel('\\textit{Velocity (\u00B0/sec)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about unicode named entity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I have implemented it now 👍
pytest.ini
Outdated
@@ -137,3 +136,4 @@ pep8ignore = | |||
*examples/pyplots/whats_new_99_axes_grid.py E225 E231 E302 E303 | |||
*examples/pyplots/whats_new_99_spines.py E231 E261 | |||
*examples/shapes_and_collections/artist_reference.py E203 | |||
*examples/text_labels_and_annotations/plot_tex.py E231 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need this anymore
fig, ax = plt.subplots(figsize=(6, 4), tight_layout=True) | ||
ax.plot(t, s) | ||
|
||
ax.set_xlabel(r'\textbf{time (s)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the fontsize and color kwargs back to a few of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? The goal of this example is not to show how to use fontsize and color kwargs (and the change of fontsize and color doesn't make the plot look better).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid losing content due to the merge. It is worth showing that the font size and colors work with latex along with our internal text rendreing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos and other corrections.
properly installed on your system. The first time you run a script | ||
you will see a lot of output from tex and associated tools. The next | ||
time, the run may be silent, as a lot of the information is cached in | ||
~/.tex.cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should mention the directory; it's an internal thing that can change, and I don't think this is even the right place on current systems.
doc/users/usetex.rst
Outdated
:include-source: | ||
|
||
Note that display math mode (``$$ e=mc^2 $$``) is not supported, but adding the | ||
command ``\displaystyle``, as in `tex_demo.py`, will produce the same | ||
command ``\displaystyle``, as in `plo_tex.py`, will produce the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plo -> plot
doc/devel/documenting_mpl.rst
Outdated
@@ -310,7 +310,7 @@ git. Please also add a line to the README in doc/pyplots for any additional | |||
requirements necessary to generate a new figure. Once these steps have been | |||
taken, these figures can be included in the usual way:: | |||
|
|||
.. plot:: mpl_examples/pyplots/tex_unicode_demo.py | |||
.. plot:: mpl_examples/text_lables_and_annotations/plot_tex.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lables -> labels
s = np.cos(4 * np.pi * t) + 2 | ||
|
||
t = np.arange(0.0, 1.0 + 0.01, 0.01) | ||
s = np.cos(2*2*np.pi*t) + 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines just replaced the previous t
and s
; they also appear to do almost the same thing.
determinism_tex.svg
Outdated
@@ -0,0 +1,29 @@ | |||
<?xml version="1.0" encoding="utf-8" standalone="no"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be added. Please rebase and remove it.
I rebased the file out myself so we could merge this. |
This PR is to address issue #7956 .
Merged the two examples/pylab_examples/tex_X.py files into a single tex.py file.