Repository navigation
Closed
Labels
Milestone
Description
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
ggrrll commentedon Feb 21, 2017
my spec:
phobson commentedon Feb 21, 2017
It appears you need to install from the current git master to use the
labelrotationkwarg.Compare v2.0 docs vs. master docs
QuLogic commentedon Feb 22, 2017
Yep, you're looking at development docs, not 2.0.0 docs.
tdpetrou commentedon Oct 9, 2017
I just installed 2.1 and
labelrotationdoes not work.rotationdoes however. Also it would be nice ifax.tick_paramsdid horizontal alignment as well.tacaswell commentedon Oct 9, 2017
The docs do in fact say
labelrotationshould work, but it does nothttp://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.tick_params.html
tacaswell commentedon Oct 9, 2017
Not sure if the correct fix is to make the docs match the code or the code match the docs though.
jklymak commentedon 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 commentedon Oct 9, 2017
tacaswell commentedon Oct 9, 2017
Is there a way to rotate the ticks ?
FIX: make labelrotation work as kwarg to tick_params as documented
jklymak commentedon Nov 7, 2017
This is closed via #9633 I believe