Hi all,

I am trying to change the labels of minor ticks, but leave the labels of the 
major ticks unchanged. To do this, I use the following function:

ax = plt.subplot(111)
ax.set_xticks([1,3,5])
ax.set_xticks([2,4], minor=True)
ax.set_xticklabels(["a", "b"], minor=True)

However, in result of the function both minor and major tick labels are 
changes. I checked the source code of XAxis.set_ticklabels and it contains 
following lines:

axis.py: lines 1335-1342

        if minor:
            self.set_minor_formatter(mticker.FixedFormatter(ticklabels))
            ticks = self.get_minor_ticks()
        else:
            self.set_major_formatter( mticker.FixedFormatter(ticklabels) )
            ticks = self.get_major_ticks()

        self.set_major_formatter( mticker.FixedFormatter(ticklabels) )

Note that the last lines sets the major tick formatter regardless of the 
"minor" argument. Is it intentional behaviour?

Yours,

Bartosz
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to