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

Skip to content

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

Merged
merged 3 commits into from
May 29, 2017

Conversation

helmiriawan
Copy link
Contributor

@helmiriawan helmiriawan commented Mar 5, 2017

This PR is to address issue #7956 .
Merged the two examples/pylab_examples/tex_X.py files into a single tex.py file.

plt.plot(t, s)

plt.xlabel(r'\textbf{time (s)}')
plt.ylabel('\\textit{Velocity (\u00B0/sec)}', fontsize=16)
Copy link
Contributor

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...)




plt.figure(2, figsize=(6, 4))
Copy link
Contributor

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)}')
Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Member

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)}')
Copy link
Member

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?

Copy link
Member

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).

Copy link
Member

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.

Copy link
Member

@QuLogic QuLogic left a 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
Copy link
Member

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.

: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
Copy link
Member

Choose a reason for hiding this comment

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

plo -> plot

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

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
Copy link
Member

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.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Mar 12, 2017
@QuLogic QuLogic dismissed their stale review March 13, 2017 00:52

Corrections made.

@QuLogic QuLogic modified the milestones: 2.1 (next point release), 2.0.1 (next bug fix release) Mar 20, 2017
@anntzer anntzer changed the title merged the tex_X.py files into a single file tex.py [MRG+1] merged the tex_X.py files into a single file tex.py Apr 16, 2017
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
Copy link
Member

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.

@QuLogic QuLogic dismissed their stale review May 29, 2017 00:37

Removed extra file.

@QuLogic QuLogic changed the title [MRG+1] merged the tex_X.py files into a single file tex.py merged the tex_X.py files into a single file tex.py May 29, 2017
@QuLogic QuLogic merged commit cc2c508 into matplotlib:master May 29, 2017
@QuLogic
Copy link
Member

QuLogic commented May 29, 2017

I rebased the file out myself so we could merge this.

@anntzer anntzer mentioned this pull request Aug 31, 2017
16 tasks
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.

7 participants