Skip to content

DOC: add links to examples for a few examples #11019

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 1 commit into from
Apr 11, 2018

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Apr 10, 2018

PR Summary

Following the suggestion in #10974 by @ImportanceOfBeingErnest , this PR adds a "References" sections to a few randomly chosen examples. This should form links in the API docs to the examples.

The only disadvantage to this approach that I can see is that we have to import matplotlib for the examples to still work.

This isn't meant to be comprehensive (at all) but following this approach for future examples and modified examples would greatly increase the cross-referencing between examples and API docs...

The code to include is

#############################################################################
#
# ------------
#
# References
# """"""""""
#
# The use of the following functions and methods is shown in this example:

import matplotlib 
matplotlib.axes.Axes.hist
matplotlib.axes.Axes.set_title
matplotlib.axes.Axes.set_xlabel
matplotlib.axes.Axes.set_ylabel

plot

https://8868-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/_as_gen/matplotlib.axes.Axes.plot.html#examples-using-matplotlib-axes-axes-plot

pcolormesh:

https://8868-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/_as_gen/matplotlib.axes.Axes.pcolormesh.html#matplotlib.axes.Axes.pcolormesh

scatter:

https://8868-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/_as_gen/matplotlib.axes.Axes.scatter.html#matplotlib.axes.Axes.scatter

hist

https://8868-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/_as_gen/matplotlib.axes.Axes.hist.html#matplotlib.axes.Axes.hist

@jklymak jklymak force-pushed the doc-add-links-in-examples branch from 66b0934 to ce25253 Compare April 10, 2018 19:46
@phobson phobson merged commit 834cfc8 into matplotlib:master Apr 11, 2018
@phobson
Copy link
Member

phobson commented Apr 11, 2018

this is such a good idea.

@jklymak
Copy link
Member Author

jklymak commented Apr 11, 2018

All credit goes to @ImportanceOfBeingErnest for the good idea!

Given that this has some approval, I'll toss a few of these in every few days just to build up the galleries. (and others should as well if they feel like it).

@jklymak jklymak added this to the v2.2-doc milestone Apr 11, 2018
@jklymak
Copy link
Member Author

jklymak commented Apr 11, 2018

@meeseeksdev backport to v2.2-doc

@lumberbot-app
Copy link

lumberbot-app bot commented Apr 11, 2018

Something went wrong ... Please have a look at my logs.

@jklymak
Copy link
Member Author

jklymak commented Apr 11, 2018

@meeseeksdev backport to v2.2.2-doc

@jklymak jklymak deleted the doc-add-links-in-examples branch April 11, 2018 21:05
@ImportanceOfBeingErnest
Copy link
Member

I fear if everyone just updates a few examples at random, this will become great chaos. So if, as it seems to be the case, there is general agreement for this method, I would say there should be an attempt to do this with all examples.

I think that all examples are actually part of the gallery. Is that correct? The gallery is divided into sections. There could be one Issue with a table of all sections and next to it an assignee and a "completed" flag. If someone wants to contribute they'd anounce it in that Issue and gets his name written next to the section. He could then open the PR and once completed, mark as such in the main issue.

@phobson
Copy link
Member

phobson commented Apr 11, 2018

It's nice to keep track of things like that. But in general, we don't have problems with "everyone" or even "more than a handful of people" trying to do the same thing.

If you look at the first few pages of PRs, it's a pretty small set of people contributing documentation. Those among them who like to do this kind of thing should feel free to do so.

@ImportanceOfBeingErnest
Copy link
Member

My suggestion was all about keeping track, indeed. Maybe you don't care if two or more people end up doing the exact same work, but it is sure frustrating for those people finding out that they could have spend their time doing more useful things if they had only known that someone else is working on the same thing at the same time. There is a new-contributor-friendly label or so which could invite people to join this effort.

@jklymak
Copy link
Member Author

jklymak commented Apr 11, 2018

I wasn't aiming for anything so comprehensive, but if someone wants to lead the charge I'd comply. I just thought of trying to do a critical mass of these so folks realize they are a thing to do, and then let the examples be updated as they come up or as folks have energy.

@ImportanceOfBeingErnest if you were thinking of a) organizing a full-on effort to do this, I'd be happy to participate, or b) were going to poke away at it yourself, then the two of us could co-ordinate (like you start at "A" and I start at "Z").

jklymak added a commit that referenced this pull request Apr 11, 2018
@timhoffm
Copy link
Member

@ImportanceOfBeingErnest I'm doing something similar for the docstrings in #10148. The main advantage of such a list is to keep track of what has been done and what still needs to be done. Duplicated work is less of a problem since each change is comparably small and can be commited quite soon. Of course, if someone wants to reserve a block to work on he can mark that in the list.

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