Skip to content

Some documentation on main page points to obsolete subdirectories #10016

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
quentinfrancois0 opened this issue Dec 15, 2017 · 63 comments
Closed
Assignees

Comments

@quentinfrancois0
Copy link

quentinfrancois0 commented Dec 15, 2017

EDIT (jklymak) Old title is below:

Fundamental issue is that If you do a search on "radar plot matplotlib" you get sent here:

https://matplotlib.org/examples/api/radar_chart.html

This of course refers to 2.0.2 and /examples/ isn't a directory any more in our tree.

  1. Robots should probably be redirected to the proper page.
  2. It'd be nice if the old docs could get a version marker as per PR Add version to documentation header #10065

Example of radar chart (matplotlib v.2.1.1) doesn't work

I just tried to run the radar chart example on a Mac (MacOS 10.13.1) with python 3.5.4 and matplotlib 2.1.1. and the radars aren't displayed correctly.

capture d ecran 2017-12-15 a 15 25 24

I found that this is the set_varlabels function which shifts the radars. Without the line 189 : ax.set_varlabels(spoke_labels) the radars look like that (but without the labels).

capture d ecran 2017-12-15 a 15 32 13

As I'm new on matplotlib and python I didn't succeed in finding a solution.

Thank's for your help

@jklymak
Copy link
Member

jklymak commented Dec 15, 2017

I can't replicate this on Master, and the doc example built OK, so I'm not clear where your error is coming from. Are you sure you are using 2.1.1? i.e. print(matplotlib.__version__). What backend are you using, etc...

@quentinfrancois0
Copy link
Author

capture d ecran 2017-12-15 a 16 03 43

@jklymak
Copy link
Member

jklymak commented Dec 15, 2017

Hmmm, well I can't replicate using 2.1.1 and MacOSX as well, so... My guess would be your install is slightly messed up. Try a fresh install?

@quentinfrancois0
Copy link
Author

I tried with python 3.6.3 installed with Homebrew and the same problem
capture d ecran 2017-12-15 a 16 13 21

@jklymak
Copy link
Member

jklymak commented Dec 15, 2017

How are you running the example from inside ipython? If possible, put the print statements in the example just to be sure that is actually the environment you are using. BTW< the above indicates you are still using the Anaconda build. I'm not sure what "Anaconda custom" means. Maybe thats what brew installs...

@quentinfrancois0
Copy link
Author

I run the example from the terminal, not from ipython. I deleted the Anaconda app and tried with the python 2.7.10 from MacOS and it is ok but it's not with the 3.6.3 installed with Homebrew

@jklymak
Copy link
Member

jklymak commented Dec 15, 2017

Not convinced you were actually running w 2.1.1 then. Copy the example locally and run w the print statements.

If it was me I’d stick w Anaconda. Make sure you install pip and IPython into your environment. Don’t install matpltolib w pip. Conda works really well but can still lead to conflicting versions of things lying around.

@quentinfrancois0
Copy link
Author

You're right, it's the 1.3.1 version with the python 2.7.10. So, the only way to run properly the example is with another version than the 2.1.1. Sorry, I'm very slow because I'm a little lost with the different version of python and the conflicts between the versions.

So you think it's better to work with Conda than the version with Homebrew ?

@jklymak
Copy link
Member

jklymak commented Dec 15, 2017

No I’m not convinced you were using 2.1.1 when you got the error. Can you please reproduce the error with the version number printed from the script. I can not reproduce the error on a Mac using 2.1.1 so the most likely problem is your setup.

Again strongly suggest anaconda and using conda to install matplotlib not pip.

@jklymak
Copy link
Member

jklymak commented Dec 16, 2017

I'll close. Feel free to reopen if you really think there is a matplotlib bug and you have solid debug info. If you continue to have install problems please try the mailing list or stack overflow.

@jklymak jklymak closed this as completed Dec 16, 2017
@quentinfrancois0
Copy link
Author

quentinfrancois0 commented Dec 18, 2017

I come back after some tests. I reinstalled conda, updated matplotlib with conda. When I installed conda, I had the 2.1.0 version but the update didn't solve the issue. I still have the problem.
capture d ecran 2017-12-18 a 12 32 54

Reminder
MacOS 10.13.1

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

Please put the print statements in the example. Otherwise you can easily trick yourself as to what version of python you are running.

@quentinfrancois0
Copy link
Author

I'm really sorry and I feel very noob but what's the print statement you talk about ? Did you mean that I have to ask clearly the version of python with python -V rather than with conda list python ?

I'm continuing to try to find a solution and I found a weird thing. If I make conda update matplotlib I obtain a custom version of anaconda. If I don't make it I have the version 2.1.0.
capture d ecran 2017-12-18 a 17 03 40

I tested with the two possibilities and none is working

  • python 3.6.3 custom python + matplotlib 2.1.1.
  • python 3.6.3 + matplotlib 2.1.0

Here is the sequence I used to run the 2 tests
capture d ecran 2017-12-18 a 17 07 26

Thanks for helping me ! Really !

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

Copy the script you are running to your local directory, and add the print statements after you import matplotlib:

import matplotlib
import sys

print(sys.version)
print('matplotlib.__version__')
print(matplotlib.get_backend())

@quentinfrancois0
Copy link
Author

quentinfrancois0 commented Dec 18, 2017

capture d ecran 2017-12-18 a 17 16 03

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

Sorry, typo. Don't put the version in quotes....

@quentinfrancois0
Copy link
Author

Yes, I just modified the image, I saw after posting sorry

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

And that gives you the distorted radar chart? I'll re-open, but someone else will have to reproduce...

@jklymak jklymak reopened this Dec 18, 2017
@quentinfrancois0
Copy link
Author

quentinfrancois0 commented Dec 18, 2017

Yes, always the bug. For informations, I'm on a new Mac Book Pro touch bar. I don't know if the hardware could change something.
capture d ecran 2017-12-18 a 17 18 43

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

I doubt the slight difference in pythons make a difference here

$ pythonw ./radar_chart.py
3.6.3 | packaged by conda-forge | (default, Dec  9 2017, 16:20:51)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
2.1.1
MacOSX

figure_1

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

Are you sure you didn't modify radar_chart.py asside from the print statements? At this point I would completely uninstall conda and try again, but I a[preciate that may not be an option

@quentinfrancois0
Copy link
Author

I modified the legend only just to test. But to be definitely sure I will test to download the exact file but there is no chance to be that because I have already redowloaded it and tested it. I have already completely uninstall conda and try again too.

@quentinfrancois0
Copy link
Author

quentinfrancois0 commented Dec 18, 2017

With the exact file
capture d ecran 2017-12-18 a 18 33 20

@quentinfrancois0
Copy link
Author

It seems to be the center of the axis, doesn't it ?

@WeatherGod
Copy link
Member

WeatherGod commented Dec 18, 2017 via email

@quentinfrancois0
Copy link
Author

I've never modified the matplotlibrc file. Just downloaded conda and updated matplotlib to 2.1.1.

@jklymak
Copy link
Member

jklymak commented Dec 18, 2017

Just to be sure, can you remove ~/.matplotlib (or move it to ~/.matplotlibOld if you might have something in there you want)?

@quentinfrancois0
Copy link
Author

quentinfrancois0 commented Dec 21, 2017

I come back with another test : with anaconda2 (python version 2.7) I have the same problem while with python2.7 coming with MacOS I haven't the bug. Very weird ..

@quentinfrancois0
Copy link
Author

I just tried by installing python 3.6.4., create a virtualenv and try to run and the same bug ! The only way is to use the python2.7 coming with MacOS

@quentinfrancois0
Copy link
Author

quentinfrancois0 commented Dec 22, 2017

I tried on W10 with python 3.6 and I have the bug too. I think there is something I'm making wrong.. This isn't the code because we juste copy-paste the code from internet. I'm really lost ..

@jklymak
Copy link
Member

jklymak commented Dec 22, 2017

What exact code are you using? Please re-write it here.

@quentinfrancois0
Copy link
Author

I copy paste the code on this page : https://matplotlib.org/examples/api/radar_chart.html

@jklymak
Copy link
Member

jklymak commented Dec 22, 2017

That example changed in 2.1.1. Whats more, the docs shouldn't have those links any more, and indeed you are linking to 2.0.2 there. The new link is https://matplotlib.org/gallery/api/radar_chart.html

This is definitely a documentation bug though. The canonical docs should not still have links to https://matplotlib.org/examples/

@jklymak
Copy link
Member

jklymak commented Dec 22, 2017

ping @tacaswell @QuLogic @anntzer or anyone else who understands how the docs are all linked up. This was pretty confusing: examples should not be a thing in the top-level docs of the non-historical docs if possible.

@quentinfrancois0
Copy link
Author

Yes it is working !! Finally !! Thank's a lot for your help @jklymak and sorry I really didn't see that was a old version ..

@jklymak
Copy link
Member

jklymak commented Dec 22, 2017

Not at all your fault. Sure google sent you there and there is no indication it’s old doc except up in the tab title. The canonical docs really should not point to old pages!

@QuLogic
Copy link
Member

QuLogic commented Dec 22, 2017

See #9556.

@tacaswell
Copy link
Member

What is different between the two examples? The only change I can see is 202f40f and I do not understand why that would cause this...

And yes, we definitely need to clean up the 'canonical' docs...

@quentinfrancois0 Sorry for the frustration and thanks for sticking with us!

@jklymak
Copy link
Member

jklymak commented Dec 22, 2017

No self.set_theta_zero_location('N') in the old code?

@jklymak
Copy link
Member

jklymak commented Dec 22, 2017

Theta changed meaning in one of the calls.

@dstansby
Copy link
Member

I'm going to close this, as the example in the current version of the docs works fine.

@tapajyoti-ghosh
Copy link

I am having the same problem using W10, python 3.6 and matplotlib v2.2

@dstansby
Copy link
Member

Could you upgrade to Matplotlib 2.2.2 (the latest version) and try again?

@tapajyoti-ghosh
Copy link

tapajyoti-ghosh commented Jun 30, 2018

They should make the v2.2.2 bigger in the websites from where we are copying tho code and have a specific warning for that . It took me 2 hours to figure the version problem.

@jklymak jklymak reopened this Jun 30, 2018
@jklymak
Copy link
Member

jklymak commented Jun 30, 2018

I'll re-open. Someone needs to sort out how to get the old pages to at least have a big blaring banner across them that says they are obsolete.

@jklymak jklymak changed the title Example of radar chart (matplotlib v.2.1.1) doesn't work Some documentation on main page points to obsolete subdirectories Jun 30, 2018
@JazzTap
Copy link

JazzTap commented Jul 14, 2018

@JLegs and I are working on documentation duplication at the sprint.

The static site has a ton* of old-version docs, that are manually propagated to the top-level on release.

Our plan is to inject old-version docs with approximate canonical links (for bots) and banners (for humans) via script, one folder at a time.

The first-approximation canonical link (#9556) is to delete the version string from the url.

More sophisticated approaches (#10854) to identifying similar-content/different-named descendants are punted. In the future, such would improve cleanup on docs release, relevant to OP's issue.

* All versions of matplotlib will remain documented in the (huge) static site because scientific users need reproducibility but can't maintain local packages. (Notably, 2.2.2 is long-term support officially; 1.5.3 is not.)

Edit: PR submitted. But - nothing apparent forwards to a 404 because nothing, not even 'examples' transitioned to 'gallery', has been cleanup'd. We could begin cautiously: instead of deleting, add warnings to 'current' (unversioned) docs which aren't in latest version?

@QuLogic
Copy link
Member

QuLogic commented Feb 12, 2021

Canonical links and redirects were added in matplotlib/matplotlib.github.com#49. There is also a banner noting that the page is outdated at the top of the page.

@QuLogic QuLogic closed this as completed Feb 12, 2021
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

8 participants