Skip to content

Document How-to figure empty #15297

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

Conversation

timhoffm
Copy link
Member

PR Summary

This adds a how-to entry on checking whether a figure is empty. Closes #15256. See discussion there.

@vanillajonathan does this address your documentation wishes?

@timhoffm timhoffm added this to the v3.1-doc milestone Sep 18, 2019
@@ -1,7 +1,7 @@
.. _howto-faq:

******
How-To
How-to
Copy link
Member Author

Choose a reason for hiding this comment

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

We only capitalize the first letter in headings (also looks better IMHO).

.. _howto-figure-empty:

Check whether a figure is empty
-------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

So, the next section uses findobj, can these two sections not be combined?

I think it would be nice if this info also went into figure.findobj. I was a little confused by this - I'd have just checked figure.get_children() findobj traverses the whole tree, I suspect needlessly for this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, get_children() is sufficient. Thanks, changed.

I don't know how to combine these sections - maybe don't have to anymore because they now use different methods. Will modify docstrings in a separate PR. Otherwise we can't port this back to the doc branch.

@vanillajonathan
Copy link

@timhoffm, Looks good to me!

@ImportanceOfBeingErnest ImportanceOfBeingErnest merged commit c7a1aa0 into matplotlib:master Sep 21, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 21, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 21, 2019
@timhoffm timhoffm deleted the doc-figure-empty branch September 21, 2019 21:33
timhoffm added a commit that referenced this pull request Sep 21, 2019
…297-on-v3.1.1-doc

Backport PR #15297 on branch v3.1.1-doc (Document How-to figure empty)
timhoffm added a commit that referenced this pull request Sep 21, 2019
…297-on-v3.1.x

Backport PR #15297 on branch v3.1.x (Document How-to figure empty)
tacaswell added a commit that referenced this pull request Jan 13, 2020
Net changes:

 - whitespace in mpl.css and layout.html
 - content from #15297 was backported to v3.1.x but not v3.2.x

Conflicts:
	.travis.yml
          - kept v3.2.x version, script changed to case statement not if-else
	doc/_static/mpl.css
          - whitespace related conflicts
	doc/_templates/layout.html
          - whitespace related conflicts
	doc/index.rst
          - join our community section completely re-written, kept
          3.2.x version
	doc/devel/documenting_mpl.rst
	lib/matplotlib/backend_bases.py
	lib/matplotlib/rcsetup.py
	lib/matplotlib/tests/test_axes.py
	lib/matplotlib/tests/test_backend_qt.py
	lib/matplotlib/tests/test_backend_webagg.py
	lib/matplotlib/tests/test_image.py
          - kept v3.2.x version
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.

Check if canvas is clean or dirty
4 participants