Skip to content

Commit

Permalink
Merge pull request #5161 from zblz/log-ticks
Browse files Browse the repository at this point in the history
API: Changes to default log scale tick formatting
  • Loading branch information
tacaswell committed Aug 22, 2016
2 parents 22aa800 + 5c28e95 commit 947e6eb
Show file tree
Hide file tree
Showing 6 changed files with 333 additions and 101 deletions.
8 changes: 4 additions & 4 deletions lib/matplotlib/scale.py
Expand Up @@ -8,7 +8,7 @@

from matplotlib.cbook import dedent
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
LogFormatterMathtext, LogitFormatter)
LogFormatterSciNotation, LogitFormatter)
from matplotlib.ticker import (NullLocator, LogLocator, AutoLocator,
SymmetricalLogLocator, LogitLocator)
from matplotlib.transforms import Transform, IdentityTransform
Expand Down Expand Up @@ -304,9 +304,9 @@ def set_default_locators_and_formatters(self, axis):
log scaling.
"""
axis.set_major_locator(LogLocator(self.base))
axis.set_major_formatter(LogFormatterMathtext(self.base))
axis.set_major_formatter(LogFormatterSciNotation(self.base))
axis.set_minor_locator(LogLocator(self.base, self.subs))
axis.set_minor_formatter(NullFormatter())
axis.set_minor_formatter(LogFormatterSciNotation(self.base))

def get_transform(self):
"""
Expand Down Expand Up @@ -462,7 +462,7 @@ def set_default_locators_and_formatters(self, axis):
symmetrical log scaling.
"""
axis.set_major_locator(SymmetricalLogLocator(self.get_transform()))
axis.set_major_formatter(LogFormatterMathtext(self.base))
axis.set_major_formatter(LogFormatterSciNotation(self.base))
axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(),
self.subs))
axis.set_minor_formatter(NullFormatter())
Expand Down
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/log_scales.pdf
Binary file not shown.
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/log_scales.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 947e6eb

Please sign in to comment.