Fixed logformatting for non integer bases. by pelson · Pull Request #960 · matplotlib/matplotlib · GitHub
Skip to content

Fixed logformatting for non integer bases.#960

Merged
WeatherGod merged 2 commits into
matplotlib:masterfrom
pelson:issue_909
Aug 3, 2012
Merged

Fixed logformatting for non integer bases.#960
WeatherGod merged 2 commits into
matplotlib:masterfrom
pelson:issue_909

Conversation

@pelson

@pelson pelson commented Jun 20, 2012

Copy link
Copy Markdown
Member

Fixes #909.

Comment thread lib/matplotlib/ticker.py

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@pelson

pelson commented Jul 5, 2012

Copy link
Copy Markdown
Member Author

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

@WeatherGod

Copy link
Copy Markdown
Member

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?

@pelson

pelson commented Jul 21, 2012

Copy link
Copy Markdown
Member Author

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?

@WeatherGod

Copy link
Copy Markdown
Member

Yes. Do all the string formatting at once.

@pelson

pelson commented Jul 28, 2012

Copy link
Copy Markdown
Member Author

Ok @WeatherGod, I think this resolves your concern.

@mdboom

mdboom commented Aug 3, 2012

Copy link
Copy Markdown
Member

Looks good to me. Feel free to merge.

@WeatherGod

Copy link
Copy Markdown
Member

WeatherGod added a commit that referenced this pull request Aug 3, 2012
Fixed logformatting for non integer bases.
@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log Formatter for tick labels can't handle non-integer base

3 participants