Skip to content

DOC: add a semicolon to hide long matplotlib axes return value #34393

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 2 commits into from
May 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/source/user_guide/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ You can create a scatter plot matrix using the
df = pd.DataFrame(np.random.randn(1000, 4), columns=['a', 'b', 'c', 'd'])

@savefig scatter_matrix_kde.png
scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde')
scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde');
Copy link
Member

Choose a reason for hiding this comment

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

Does using plt.show() have the same effect? May look a bit more natural.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure how to do this using plt.show()

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine. IPython will show any output of each line. So adding a plt.show() will not prevent printing the output of this line.

Copy link
Member

Choose a reason for hiding this comment

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

This seems like a strange one-off so would prefer what @dsaxton suggests if it works

IPython will show any output of each line.

Is that a general comment or specific to just doc rendering? Running this in ipython:

a = [1, 2, 3]
a
print("done")

Only prints "done"

Copy link
Member

Choose a reason for hiding this comment

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

Is that a general comment or specific to just doc rendering?

The IPython directive runs line by line (so it's not the same copy pasting it in an ipython console, but rather as copy pasting line by line)

This seems like a strange one-off

We already do this in several places in this visualization.rst, so it's not a one-off

Copy link
Member

Choose a reason for hiding this comment

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

Ah OK thanks for the explanation. lgtm to then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are about 40 semicolons in visualization.rst but there are also many plots which don't have semicolons and show the debug messages.
Should we put a semicolon after every plot in visualization.rst?


.. ipython:: python
:suppress:
Expand Down Expand Up @@ -1683,4 +1683,4 @@ to generate the plots. Some libraries implementing a backend for pandas are list
on the ecosystem :ref:`ecosystem.visualization` page.

Developers guide can be found at
https://dev.pandas.io/docs/development/extending.html#plotting-backends
https://dev.pandas.io/docs/development/extending.html#plotting-backends