pyplot.yticks ignoring font if labels are supplied, any ideas?

import matplotlib.pyplot as pyplot

fprop=matplotlib.font_manager.FontProperties(size='xx-small')

pyplot.yticks((70,80,90,100),('70%','80%','90%','100%'),
color="#8c949d",horizontalalignment='right',fontproperties=fprop )

This will cause all the kwargs to be ignored, so the color, alignment and
fonts are all at their default values.

pyplot.yticks((70,80,90,100),color="#8c949d",horizontalalignment='right',fontproperties=fprop
)

this on, on the other hand, works fine.

This is showing that when you provide labels for the ticks (second arg to
yticks), the kwargs are ignored. Does anyone have any idea why this is the
case?

···


View this message in context: http://old.nabble.com/pyplot.yticks-ignoring-font-if-labels-are-supplied%2C-any-ideas--tp27553479p27553479.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

ristretto wrote:

import matplotlib.pyplot as pyplot

fprop=matplotlib.font_manager.FontProperties(size='xx-small')

pyplot.yticks((70,80,90,100),('70%','80%','90%','100%'),
color="#8c949d",horizontalalignment='right',fontproperties=fprop )

This will cause all the kwargs to be ignored, so the color, alignment and
fonts are all at their default values.

pyplot.yticks((70,80,90,100),color="#8c949d",horizontalalignment='right',fontproperties=fprop
)

this on, on the other hand, works fine.

This is showing that when you provide labels for the ticks (second arg to
yticks), the kwargs are ignored. Does anyone have any idea why this is
the case?

I'm not sure I'll ever really understand Matplotlib. Why I had to do this,
I don't really know. It's hard to spec out projects when you think that
setting the font on some text should take no time at all, but it takes hours
due to stupid complexities.

Rant over, here's what I did

    pyplot.yticks((70,80,90,100),
color="#8c949d",horizontalalignment='right',fontproperties=fprop2 )
   
ax.set_yticklabels(('70%','80%','90%','100%'),color="#8c949d",horizontalalignment='right')

The first line doesn't specify the labels, this works in that it puts 70 80
90 100 as labels, but with correct color and font.

The second line sets the label text, but not the font or color.

This seems to work.

···

--
View this message in context: http://old.nabble.com/pyplot.yticks-ignoring-font-if-labels-are-supplied%2C-any-ideas--tp27553479p27554596.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

While developers are working hard to fix any bugs, Matplolib is not a
perfect, bug-free library. And I doubt if it ever will be (to
clarify, I'm one of the developers).

And with the 0.99 maintenance branch and the current svn, I cannot
reproduce your problem, so I guess this is a known bug that has been
fixed already.

-JJ

···

On Thu, Feb 11, 2010 at 3:55 PM, ristretto <ristretto.rb@...287...> wrote:

I'm not sure I'll ever really understand Matplotlib. Why I had to do this,
I don't really know. It's hard to spec out projects when you think that
setting the font on some text should take no time at all, but it takes hours
due to stupid complexities.

While developers are working hard to fix any bugs, Matplolib is not a
perfect, bug-free library. And I doubt if it ever will be (to
clarify, I'm one of the developers).

And with the 0.99 maintenance branch and the current svn, I cannot
reproduce your problem, so I guess this is a known bug that has been
fixed already.

-JJ

Hi, I hear you. I'm a developer too (not on matplotlib.) It's hard to
keep it all together all the time, and keep everyone happy. I wish you the
best.

I'm using

   python-matplotlib 0.99.0-1ubuntu1

on Ubuntu 9.10

···

--
View this message in context: http://old.nabble.com/pyplot.yticks-ignoring-font-if-labels-are-supplied%2C-any-ideas--tp27553479p27555804.html
Sent from the matplotlib - users mailing list archive at Nabble.com.