Fixed logformatting for non integer bases. #960

Merged
merged 2 commits into from Aug 3, 2012

Conversation

Projects
None yet
3 participants
Member

pelson commented Jun 20, 2012

Fixes #909.

@pelson pelson commented on the diff Jun 20, 2012

lib/matplotlib/ticker.py
@@ -567,9 +567,8 @@ class LogFormatter(Formatter):
"""
Format values for log axis;
- if attribute *decadeOnly* is True, only the decades will be labelled.
@pelson

pelson Jun 20, 2012

Member

This is not true:

$> grep -ir decadeOnly *
Binary file doc/build/doctrees/api/ticker_api.doctree matches
doc/build/html/api/ticker_api.html:<p>if attribute <em>decadeOnly</em> is True, only the decades will be labelled.</p>
lib/matplotlib/ticker.py:    if attribute *decadeOnly* is True, only the decades will be labelled.
lib/matplotlib/ticker.py:        self.decadeOnly = True
Member

pelson commented Jul 5, 2012

This is a small-ish change if anyone is prepared to go over it?

Member

WeatherGod commented Jul 21, 2012

I don't like how you do the string formatting of the 'b' variable separately from the formatting of the rest of the label. Why not do the string concatenation of the needed format string for the base and then do all the formatting at once?

Member

pelson commented Jul 21, 2012

I agree that it is a little awkward to follow. I'm not seeing your suggestion though, do you mean make base be either "%s" or "%d" and then use that for the string interpolation later on?

Member

WeatherGod commented Jul 21, 2012

Yes. Do all the string formatting at once.

Member

pelson commented Jul 28, 2012

Ok @WeatherGod, I think this resolves your concern.

Owner

mdboom commented Aug 3, 2012

Looks good to me. Feel free to merge.

Member

WeatherGod commented Aug 3, 2012

Right, thanks for that. Merging...

@WeatherGod WeatherGod added a commit that referenced this pull request Aug 3, 2012

@WeatherGod WeatherGod Merge pull request #960 from pelson/issue_909
Fixed logformatting for non integer bases.
797940f

@WeatherGod WeatherGod merged commit 797940f into matplotlib:master Aug 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment