8000 DOC: Duplicate examples of AnchoredArtists gallery · Issue #11092 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC: Duplicate examples of AnchoredArtists gallery #11092

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

Closed
madphysicist opened this issue Apr 20, 2018 · 8 comments
Closed

DOC: Duplicate examples of AnchoredArtists gallery #11092

madphysicist opened this issue Apr 20, 2018 · 8 comments

Comments

@madphysicist
Copy link
Contributor

The documentation pages at https://matplotlib.org/gallery/axes_grid1/simple_anchored_artists.html and https://matplotlib.org/gallery/misc/anchored_artists.html appear to be nearly duplicates of each other. However, the first one is much more complete, and demonstrates a much less complicated way of achieving he same thing.

The first linked page has a if 1: "guard" while the second one has if __name__ == '__main__':. Given the overall trend in the examples, neither seems necessary.

An even simpler example, that is fully covered by the other ones, is given in https://matplotlib.org/gallery/userdemo/anchored_box01.html

My personal take on this is:

I'll be happy to submit a PR if a couple of senior folks approve.

P.S. The reason for all this is in the comment section of https://stackoverflow.com/a/49933937/2988730, when I realized I was giving somebody incomplete, or possibly outright bad advice.

@madphysicist
Copy link
Contributor Author

I see how it ended up in the axesgrid documentation section now. Now the question is why AnchoredArtists are part of AxesGrid in the first place though...

madphysicist added a commit to madphysicist/matplotlib that referenced this issue Apr 20, 2018
@ImportanceOfBeingErnest
Copy link
Member

Please do not remove any of the userdemo examples. They are... well, part of the userdemos. In this case, the annotation guide.

I would also not recommend deleting any of the other two examples. They both make sense in the respecitve context. The one is an example of the anchored artists from axes_grid1, so it should be part of the axes_grid1 examples. The other shows how to do the same without axes_grid1. I would hence recommend to add some text to both examples explaining the context and also link to the respective other example.

@madphysicist
Copy link
Contributor Author

@ImportanceOfBeingErnest Thanks. That is exactly the kind of guidance I was looking for. Would it be OK to edit the user example a bit?

@jklymak
Copy link
Member
jklymak commented Apr 20, 2018

@madphysicist Any edits to the examples gratefully received if they help improve understanding!

@ImportanceOfBeingErnest
Copy link
Member

The userdemo example should above all be quite short and make sense in the context of the annotations guide. What you definitely can do is bring the code in the annotations guide and the code from the example in accordance (they seem to be a bit off).

Also feel free to adjust things like if True or if __name__ if that helps the example to be easier to understand.

In general a little bit of explanations above or below the examples is always useful.

madphysicist added a commit to madphysicist/matplotlib that referenced this issue Apr 20, 2018
No files were delete, instead, a clarifying comment was added to
indicate why there are nearly duplicate files sitting around.

[ci skip] [skip ci]
madphysicist added a commit to madphysicist/matplotlib that referenced this issue Apr 20, 2018
No files were delete, instead, a clarifying comment was added to
indicate why there are nearly duplicate files sitting around.

[ci skip] [skip ci]
madphysicist added a commit to madphysicist/matplotlib that referenced this issue Apr 20, 2018
No files were delete, instead, a clarifying comment was added to
indicate why there are nearly duplicate files sitting around.

[ci skip] [skip ci]
@madphysicist
Copy link
Contributor Author

@ImportanceOfBeingErnest Besides the font and figure size, there are no significant differences between the annotations guide and the user example (once I undid my changes). What did you have in mind?

@ImportanceOfBeingErnest
Copy link
Member

Figure size doesn't matter, because it's not in the userguide. But, yes, fontsize and linebreaks are different. And if you want to change loc=2 to loc="upper left" that should happen in both codes.

madphysicist added a commit to madphysicist/matplotlib that referenced this issue Apr 24, 2018
No files were delete, instead, a clarifying comment was added to
indicate why there are nearly duplicate files sitting around.

[ci skip] [skip ci]
@story645
Copy link
Member

Some of those user demos can probably be removed since the figures in the annotation guide are generated in the guide directly as of #23606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0