Description
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:
- Keep the content of https://matplotlib.org/gallery/axes_grid1/simple_anchored_artists.html. The other version asks the user to write their own version of the anchored artist classes, even though matplotlib already provides them, and is generally less complete.
- Move it to https://matplotlib.org/gallery/misc/anchored_artists.html since it has nothing to do with axis grids and I'm not even sure how it ended up there.
- Removing the unnecessary import guard.
- Remove https://matplotlib.org/gallery/userdemo/anchored_box01.html entirely.
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.