Skip to content

Documentation metadata (release version) does not correspond with some of the 'younger' documentation content #5649

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
dborisog opened this issue Dec 10, 2015 · 15 comments

Comments

@dborisog
Copy link

at least I got this impression after trying to run some of the docs examples on pre-built matplotlib v1.5.0

This issue relatively soon would become obsolete with the release of v2.0, but unless it is done on purpose, it may continue as a minor issue.

@QuLogic
Copy link
Member

QuLogic commented Dec 10, 2015

Can you give an example? I don't really understand what you mean.

@dborisog
Copy link
Author

@QuLogic

I faced few minor problems wile running examples from documentation. Here is one of them explained.
http://matplotlib.org/users/pyplot_tutorial.html#logarithmic-and-other-nonlinear-axis
Operates with four scales including "logit"

In both Anaconda matplotlib v1.5.0 pre-built for Win x64, and apt-get matplotlib v1.5.0 pre-built for Ubuntu 14.04 it produces the following error. (Ubuntu file is used in the following text)

/usr/lib/pymodules/python2.7/matplotlib/scale.pyc in scale_factory(scale, axis, **kwargs)
    500 
    501     if scale not in _scale_mapping:
--> 502         raise ValueError("Unknown scale type '%s'" % scale)
    503 
    504     return _scale_mapping[scale](axis, **kwargs)

ValueError: Unknown scale type 'logit'

In this (Ubuntu) scale.py file (lines 478 - 482)

_scale_mapping = {
    'linear': LinearScale,
    'log':    LogScale,
    'symlog': SymmetricalLogScale
    }

In the github master (lines 578 - 583)

_scale_mapping = {
    'linear': LinearScale,
    'log':    LogScale,
    'symlog': SymmetricalLogScale,
    'logit':  LogitScale,
    }

In the release v1.5.0 https://github.com/matplotlib/matplotlib/releases/tag/v1.5.0

_scale_mapping = {
    'linear': LinearScale,
    'log':    LogScale,
    'symlog': SymmetricalLogScale,
    'logit':  LogitScale,
    }

Which means it's the problem on both Anaconda and apt-get sides, and therefore I submitted wrong issue report.

@jenshnielsen
Copy link
Member

The version in http://matplotlib.org/users/pyplot_tutorial.html#logarithmic-and-other-nonlinear-axis should always be build with the latest release.

The version at http://matplotlib.org/devdocs/users/pyplot_tutorial.html#logarithmic-and-other-nonlinear-axis is build automatically with latest master

The version at http://matplotlib.org/1.5.0/users/pyplot_tutorial.html#logarithmic-and-other-nonlinear-axis is always build with 1.5.0

@dborisog
Copy link
Author

@jenshnielsen , thank you for clarification

I don't know how the team approaches it, but I found no URLs directing to docs of specific release, e.g.
http://matplotlib.org/1.4.3/users/pyplot_tutorial.html#logarithmic-and-other-nonlinear-axis
while 47 releases, and v1.4.3 in particular, are listed in https://github.com/matplotlib/matplotlib/releases
Such URLs, especially for both v2.0 and v1.5.0, may become relevant with v2.0 release.

@jenshnielsen
Copy link
Member

The links to the versioned documentation is on http://matplotlib.org/ under the heading Documentation.

It would be nice if we had a drop down switcher similar to the main python documentation but we don't at the moment.

@jenshnielsen
Copy link
Member

The Logarithmic and other nonlinear axis example is not in the pyplot tutorial for version 1.4.3 because it wasn't added until #3753 which is not in 1.4.3

@liyun831229
Copy link

any update? Because I got the same error. It seems be one year since the error was reported.

@tacaswell
Copy link
Member

@liyun831229 Can you expand on what you mean?

@liyun831229
Copy link

liyun831229 commented Sep 21, 2016

I tried the example from:(http://matplotlib.org/users/pyplot_tutorial.html).
However, I got an error as below:

ValueError                                Traceback (most recent call last)
<ipython-input-15-516048c92d8b> in <module>()
     36 plt.subplot(224)
     37 plt.plot(x, y)
---> 38 plt.yscale('logit')
     39 plt.title('logit')
     40 plt.grid(True)

c:\python34\lib\site-packages\matplotlib\pyplot.py in yscale(*args, **kwargs)
   1558     """
   1559     ax = gca()
-> 1560     ax.set_yscale(*args, **kwargs)
   1561     draw_if_interactive()
   1562 

c:\python34\lib\site-packages\matplotlib\axes\_base.py in set_yscale(self, value, **kwargs)
   2852         if value.lower() == 'log' and 'nonposy' not in kwargs.keys():
   2853             kwargs['nonposy'] = 'clip'
-> 2854         self.yaxis._set_scale(value, **kwargs)
   2855         self.autoscale_view(scalex=False)
   2856         self._update_transScale()

c:\python34\lib\site-packages\matplotlib\axis.py in _set_scale(self, value, **kwargs)
    703 
    704     def _set_scale(self, value, **kwargs):
--> 705         self._scale = mscale.scale_factory(value, self, **kwargs)
    706         self._scale.set_default_locators_and_formatters(self)
    707 

c:\python34\lib\site-packages\matplotlib\scale.py in scale_factory(scale, axis, **kwargs)
    503 
    504     if scale not in _scale_mapping:
--> 505         raise ValueError("Unknown scale type '%s'" % scale)
    506 
    507     return _scale_mapping[scale](axis, **kwargs)

ValueError: Unknown scale type 'logit'

#Here is the code:

import numpy as np
import matplotlib.pyplot as plt

y = np.random.normal(loc=0.5, scale=0.4, size=1000)
y = y[(y > 0) & (y < 1)]
y.sort()
x = np.arange(len(y))

plt.figure(1)

plt.subplot(221)
plt.plot(x, y)
plt.yscale('linear')
plt.title('linear')
plt.grid(True)

plt.subplot(222)
plt.plot(x, y)
plt.yscale('log')
plt.title('log')
plt.grid(True)

plt.subplot(223)
plt.plot(x, y - y.mean())
plt.yscale('symlog', linthreshy=0.05)
plt.title('symlog')
plt.grid(True)

plt.subplot(224)
plt.plot(x, y)
plt.yscale('logit')
plt.title('logit')
plt.grid(True)

plt.show()

@WeatherGod
Copy link
Member

and what version of matplotlib do you have installed?

On Wed, Sep 21, 2016 at 3:08 PM, liyun831229 notifications@github.com
wrote:

I tried the example from:(http://matplotlib.org/users/pyplot_tutorial.html).

However, I got an error as below:

_
ValueError Traceback (most recent call last)
in ()
36 plt.subplot(224)
37 plt.plot(x, y)
---> 38 plt.yscale('logit')
39 plt.title('logit')
40 plt.grid(True)

c:\python34\lib\site-packages\matplotlib\pyplot.py in yscale(args, *
kwargs)
1558 """
1559 ax = gca()
-> 1560 ax.set_yscale(_args, *_kwargs)
1561 draw_if_interactive()
1562

c:\python34\lib\site-packages\matplotlib\axes_base.py in set_yscale(self,
value, *

_kwargs) 2852 if value.lower() == 'log' and 'nonposy' not in
kwargs.keys(): 2853 kwargs['nonposy'] = 'clip' -> 2854
self.yaxis._set_scale(value, *_kwargs)
2855 self.autoscale_view(scalex=False)
2856 self._update_transScale()

c:\python34\lib\site-packages\matplotlib\axis.py in _set_scale(self,
value, *

_kwargs) 703 704 def _set_scale(self, value, *_kwargs):
--> 705 self._scale = mscale.scale_factory(value, self, **kwargs)
706 self._scale.set_default_locators_and_formatters(self)
707

c:\python34\lib\site-packages\matplotlib\scale.py in scale_factory(scale,
axis, **kwargs)
503
504 if scale not in _scale_mapping:
--> 505 raise ValueError("Unknown scale type '%s'" % scale)
506
507 return _scale_mappingscale http://axis,%20**kwargs

ValueError: Unknown scale type 'logit'
_

#Here is the code:
`import numpy as np
import matplotlib.pyplot as plt

y = np.random.normal(loc=0.5, scale=0.4, size=1000)
y = y[(y > 0) & (y < 1)]
y.sort()
x = np.arange(len(y))

plt.figure(1)

plt.subplot(221)
plt.plot(x, y)
plt.yscale('linear')
plt.title('linear')
plt.grid(True)

plt.subplot(222)
plt.plot(x, y)
plt.yscale('log')
plt.title('log')
plt.grid(True)

plt.subplot(223)
plt.plot(x, y - y.mean())
plt.yscale('symlog', linthreshy=0.05)
plt.title('symlog')
plt.grid(True)

plt.subplot(224)
plt.plot(x, y)
plt.yscale('logit')
plt.title('logit')
plt.grid(True)

plt.show()`


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#5649 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AARy-A4dg4MnPssLPCf9dy7itzurGgtHks5qsYCXgaJpZM4Gyd2K
.

@WeatherGod
Copy link
Member

import matplotlib
print(matplotlib.version)

On Wed, Sep 21, 2016 at 3:33 PM, liyun831229 notifications@github.com
wrote:

How can I see the version


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5649 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AARy-Gl09rw2rPeMarwPQnnHYay-zDRzks5qsYaegaJpZM4Gyd2K
.

@liyun831229
Copy link

It's 1.4.3.
I feel confused. I started python from Anaconda, which is python 35 with matplotlib 1.5.1. why in the error, it shows python34 and the matplotlib is 1.4.3. It also seems that the path to python34 is not the anaconda python in my PC.

@efiring
Copy link
Member

efiring commented Sep 21, 2016

It sounds like either you have some path variables or Windows settings that are overriding what Anaconda sets, or your Anaconda environment is not activated.

@tacaswell
Copy link
Member

It looks like you have gotten your enviroment crossed. I suggest uninstalling any other versions of python you have installed. Failing that, this probably should go to the conda support lists.

@liyun831229
Copy link

Thanks for your suggestions. I will try to uninstall the other python to see if it works.

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

No branches or pull requests

7 participants