Skip to content

keyword labelrotation is not recognized #8122

Closed

Description

@ggrrll

Bug report

Bug summary
in ax.tick_params, I get this error

keyword labelrotation is not recognized
Code for reproduction

ax.tick_params(labelsize=10,labelrotation=40)

Actual outcome

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-186-fd6800d79e43> in <module>()
     12 
     13 
---> 14 ax.tick_params(labelsize=10,labelrotation=40)
     15 
     16 ax.set_xlabel('Fat',fontsize=16)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/mpl_toolkits/mplot3d/axes3d.py in tick_params(self, axis, **kwargs)
   1395             This function was added, but not tested. Please report any bugs.
   1396         """
-> 1397         Axes.tick_params(self, axis, **kwargs)
   1398         if axis in ['z', 'both'] :
   1399             zkw = dict(kwargs)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/axes/_base.py in tick_params(self, axis, **kwargs)
   2711             xkw.pop('labelleft', None)
   2712             xkw.pop('labelright', None)
-> 2713             self.xaxis.set_tick_params(**xkw)
   2714         if axis in ['y', 'both']:
   2715             ykw = dict(kwargs)

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/axis.py in set_tick_params(self, which, reset, **kw)
    789         if which == 'minor' or which == 'both':
    790             dicts.append(self._minor_tick_kw)
--> 791         kwtrans = self._translate_tick_kw(kw, to_init_kw=True)
    792         for d in dicts:
    793             if reset:

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/axis.py in _translate_tick_kw(kw, to_init_kw)
    860                     raise ValueError(
    861                         "keyword %s is not recognized; valid keywords are %s"
--> 862                         % (key, kwkeys))
    863             kwtrans.update(kw)
    864         else:

ValueError: keyword labelrotation is not recognized; valid keywords are ['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', 'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', 'right', 'top', 'labelleft', 'labelbottom', 'labelright', 'labeltop']

Activity

  1. ggrrll commented on Feb 21, 2017

    @ggrrll
    Author

    my spec:

    • macOS 10.12.3
    • Name: jupyter / Version: 1.0.0
    • Name: notebook / Version: 4.3.1
    • Name: matplotlib / Version: 2.0.0
  2. phobson commented on Feb 21, 2017

    @phobson
    Member

    It appears you need to install from the current git master to use the labelrotation kwarg.

    Compare v2.0 docs vs. master docs

  3. QuLogic commented on Feb 22, 2017

    @QuLogic
    Member

    Yep, you're looking at development docs, not 2.0.0 docs.

  4. tdpetrou commented on Oct 9, 2017

    @tdpetrou
    Contributor

    I just installed 2.1 and labelrotation does not work. rotation does however. Also it would be nice if ax.tick_params did horizontal alignment as well.

  5. tacaswell commented on Oct 9, 2017

    @tacaswell
    Member

    The docs do in fact say labelrotation should work, but it does not

    http://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.tick_params.html

  6. added this to the milestone on Oct 9, 2017
  7. tacaswell commented on Oct 9, 2017

    @tacaswell
    Member

    Not sure if the correct fix is to make the docs match the code or the code match the docs though.

  8. jklymak commented on Oct 9, 2017

    @jklymak
    Member

    Rotation is used elsewhere. I prefer kwargs stay the same between calls. Right now I can never remember if it’s location or loc.

  9. WeatherGod commented on Oct 9, 2017

    @WeatherGod
    Member
  10. tacaswell commented on Oct 9, 2017

    @tacaswell
    Member

    Is there a way to rotate the ticks ?

  11. added a commit that references this issue on Oct 30, 2017
    cedef77
  12. jklymak commented on Nov 7, 2017

    @jklymak
    Member

    This is closed via #9633 I believe

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions