Skip to content

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

Closed

Description

@dborisog

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.

Activity

  1. QuLogic commented on Dec 10, 2015

    @QuLogic
    Member

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

  2. dborisog commented on Dec 10, 2015

    @dborisog
    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.

  3. jenshnielsen commented on Dec 10, 2015

    @jenshnielsen
    Member
  4. dborisog commented on Dec 10, 2015

    @dborisog
    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.

  5. jenshnielsen commented on Dec 10, 2015

    @jenshnielsen
    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.

  6. jenshnielsen commented on Dec 10, 2015

    @jenshnielsen
    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

  7. liyun831229 commented on Sep 21, 2016

    @liyun831229

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

  8. tacaswell commented on Sep 21, 2016

    @tacaswell
    Member

    @liyun831229 Can you expand on what you mean?

  9. liyun831229 commented on Sep 21, 2016

    @liyun831229

    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()
  10. WeatherGod commented on Sep 21, 2016

    @WeatherGod
    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
    .

  11. WeatherGod commented on Sep 21, 2016

    @WeatherGod
    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
    .

  12. liyun831229 commented on Sep 21, 2016

    @liyun831229

    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.

  13. efiring commented on Sep 21, 2016

    @efiring
    Member

    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.

  14. tacaswell commented on Sep 21, 2016

    @tacaswell
    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.

  15. liyun831229 commented on Sep 22, 2016

    @liyun831229

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions