Where else to look when tick_label.set_fontsize isn't working

With the help of John Hunter and Stan West, I got some of my tick labels
sizing correctly. I have this chunk of code:

for label in self.main_axes.get_xticklabels():
    label.set_fontsize(self.xtick_labelsize)

main_ticks = self.main_axes.get_yticklabels()
sub_ticks = (self.sub_axes.get_yticklabels()
             if hasattr(self.sub_axes, 'get_yticklabels') else [])
for label in main_ticks + sub_ticks:
    label.set_fontsize(self.ytick_labelsize)

The "sub ticks" are actually sub_axis ticks, sorry if the name confuses.

Anyway...the code to set the ytick label size is working just fine.
However, the code to set the xtick labels is not changing the size of
the labels, and it's still using the default.

The X axis (a date axis) has a major formatter of NullFormatter, A minor
locator of HourLocator, and a minor formatter of DateFormatter. As far
as I know, Formatters don't mess with font size, they just return
strings.

Where else can I look if the font settings aren't being honored for the
xtick labels?

BTW, yes, I did read over the Artist docs, but what I found didn't
answer my question.

Thanks!

···

--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE

Please post a complete, free-standing example, that we can run, that
illustrates the problem.

  http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem

JDH

···

On Fri, Nov 7, 2008 at 7:51 PM, Joshua J. Kugler <joshua@...1552...> wrote:

With the help of John Hunter and Stan West, I got some of my tick labels
sizing correctly. I have this chunk of code:

for label in self.main_axes.get_xticklabels():
   label.set_fontsize(self.xtick_labelsize)

main_ticks = self.main_axes.get_yticklabels()
sub_ticks = (self.sub_axes.get_yticklabels()
            if hasattr(self.sub_axes, 'get_yticklabels') else [])
for label in main_ticks + sub_ticks:
   label.set_fontsize(self.ytick_labelsize)

On Friday 07 November 2008, John Hunter said something like:

> With the help of John Hunter and Stan West, I got some of my tick
> labels sizing correctly. I have this chunk of code:
>
> for label in self.main_axes.get_xticklabels():
> label.set_fontsize(self.xtick_labelsize)
>
> main_ticks = self.main_axes.get_yticklabels()
> sub_ticks = (self.sub_axes.get_yticklabels()
> if hasattr(self.sub_axes, 'get_yticklabels') else [])
> for label in main_ticks + sub_ticks:
> label.set_fontsize(self.ytick_labelsize)

Please post a complete, free-standing example, that we can run, that
illustrates the problem.

http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem

Sorry, I wasn't so much reporting a problem with matplotlib as I was
wondering if I was missing something. I'll try to extract a
free-standing example, but it might be hard...there's a lot of code
interacting here. I'll work on that when I get a chance.

Thanks!

j

···

On Fri, Nov 7, 2008 at 7:51 PM, Joshua J. Kugler <joshua@...1552...> wrote:

--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE

The point about making a free standing example is that often there is
some other problem with your code, and the problem is not in the part
you are posting or asking about. And we can't help with the part we
can't see. In stripping your example down to a free standing example,
often you will find the problem goes away. Then you will ask: what is
different about from free the standing example and my real code, and
in doing so find the real problem. This is not always the case, but
it happens enough that it is a worthwhile exercise. That is why a
properly crafted mailing list post is so useful -- the acting of
positing properly often fixes the bug you are trying to report even
before you hit the send button. It has happened for me countless
times. In the heat of trying to find a solution to the problem, it
is hard to justify the extra time to boil the problem down to
isolated, free-standing code, but in my experience nothing is as
effective as taking that extra step.

By not doing the extra work to make a simple example that we can run,
you are asking us to do so. Its really not that hard -- just grab one
of the date demos at
http://matplotlib.sourceforge.net/examples/index.html and set the
fonts as you are doing in your code and see if the problem persists.
If it does, post it an we will fix it. If not, you have to figure out
where the problem really resides.

I'm not trying to be snippy, it's just that the matplotlib mailing
list gets a lot of traffic, and in addition to trying to help you with
your problems, we are trying to fix bugs, add new features, solve
platform issues and distribution issues, put out releases, and we all
have jobs and families. I think you get the idea. We need you to do
the maximum amount of work possible so we can efficiently help you.
When we get a free-standing example that shows a real problem, the
odds of you getting help and patch rise dramatically.

Thanks, and good luck,
JDH

···

On Sat, Nov 8, 2008 at 1:02 AM, Joshua J. Kugler <joshua@...1552...> wrote:

On Friday 07 November 2008, John Hunter said something like:

http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem

Sorry, I wasn't so much reporting a problem with matplotlib as I was
wondering if I was missing something. I'll try to extract a
free-standing example, but it might be hard...there's a lot of code
interacting here. I'll work on that when I get a chance.

Thanks!

On Saturday 08 November 2008, John Hunter said something like:

> On Friday 07 November 2008, John Hunter said something like:
>
> http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#repo
>rt-a-problem
>
> Sorry, I wasn't so much reporting a problem with matplotlib as I
> was wondering if I was missing something. I'll try to extract a
> free-standing example, but it might be hard...there's a lot of code
> interacting here. I'll work on that when I get a chance.
>
> Thanks!

The point about making a free standing example is that often there is
some other problem with your code, and the problem is not in the part
you are posting or asking about. And we can't help with the part we
can't see. In stripping your example down to a free standing
example, often you will find the problem goes away. Then you will
ask: what is different about from free the standing example and my
real code, and in doing so find the real problem.

<snip>

By not doing the extra work to make a simple example that we can run,
you are asking us to do so.

<snip>

I'm not trying to be snippy, it's just that the matplotlib mailing
list gets a lot of traffic, and in addition to trying to help you
with your problems, we are trying to fix bugs, add new features,
solve platform issues and distribution issues, put out releases, and
we all have jobs and families.

John (and all):

Thanks for your detailed reply. I understand the need for a
free-standing example, and understand why I should do it. And if/when
I find a problem, I certainly will do that. The question I was asking
was, in effect, "Is there another setting I should try to accomplish
what I want to do." I just wanted to know if I was missing something
in the docs, not so much "Matplotlib isn't working." I'm going to work
on the problem some more today (and play around with the date graph
example you suggested) and see if I can figure out anything.

j

···

On Sat, Nov 8, 2008 at 1:02 AM, Joshua J. Kugler <joshua@...1552...> wrote:

--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE

On Saturday 08 November 2008, John Hunter said something like:

On Sat, Nov 8, 2008 at 1:02 AM, Joshua J. Kugler
> Sorry, I wasn't so much reporting a problem with matplotlib as I
> was wondering if I was missing something.

Turns out I was missing something: it was the x minor tick labels that
was being plotted, not the x major ticks. :slight_smile: But at any rate, that
brought up another issue, which is the subject of my next e-mail, and
has a minimal test case! :slight_smile:

j

···

--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE