|
From: Tony Yu <ts...@gm...> - 2012-03-14 14:06:06
|
On Wed, Mar 14, 2012 at 5:44 AM, kususe <ku...@in...> wrote:
>
> Hi folks,
> I have a graph got using the subplot command.
> I'd like to remove all ticks in X axis in all of graph.
>
> I used: plt.setp(plt.gca(),'XtickLabel',[])
>
> but I get that:
>
> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 1169, in
> setp
> func = getattr(o,funcName)
> AttributeError: 'AxesSubplot' object has no attribute 'set_xticklabel'
>
> Suggestions?
> Thanks in advance
> K
>
>
You're missing an "s"; i.e. "xticklabels". Also, the more conventional
pattern is to call the axes method, i.e.:
>>> ax = plt.gca()
>>> ax.set_xticklabels([])
or, if want to remove both labels and the tick-lines
>>> ax.set_xticks([])
Best,
-Tony
|