Skip to content

keyword labelrotation is not recognized #8122

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
ggrrll opened this issue Feb 21, 2017 · 10 comments
Closed

keyword labelrotation is not recognized #8122

ggrrll opened this issue Feb 21, 2017 · 10 comments
Milestone

Comments

@ggrrll
Copy link

ggrrll commented Feb 21, 2017

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']
@ggrrll
Copy link
Author

ggrrll commented Feb 21, 2017

my spec:

  • macOS 10.12.3
  • Name: jupyter / Version: 1.0.0
  • Name: notebook / Version: 4.3.1
  • Name: matplotlib / Version: 2.0.0

@phobson
Copy link
Member

phobson commented Feb 21, 2017

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

Compare v2.0 docs vs. master docs

@QuLogic
Copy link
Member

QuLogic commented Feb 22, 2017

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

@tdpetrou
Copy link
Contributor

tdpetrou commented Oct 9, 2017

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.

@tacaswell tacaswell reopened this Oct 9, 2017
@tacaswell
Copy link
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

@tacaswell tacaswell added this to the 2.1.1 (next bug fix release) milestone Oct 9, 2017
@tacaswell
Copy link
Member

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

@jklymak
Copy link
Member

jklymak commented Oct 9, 2017

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

@WeatherGod
Copy link
Member

WeatherGod commented Oct 9, 2017 via email

@tacaswell
Copy link
Member

Is there a way to rotate the ticks ?

@jklymak
Copy link
Member

jklymak commented Nov 7, 2017

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
Projects
None yet
Development

No branches or pull requests

7 participants