Skip to content

Not all labels colored in scientific notation #12076

@tdegeus

Description

@tdegeus

Bug report

Bug summary

axis.tick_params(axis='y', colors='b') fails to color all labels in scientific notation. It fails on numbers that are not a full decade (e.g. 2 x 10^1).

Code for reproduction

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

ax.plot([1,5,10],[1,5,10])

ax.set_xscale('log')
ax.set_yscale('log')

ax.set_xlim([1e0,1e1])
ax.set_ylim([1e0,1e1])

ax.yaxis.label.set_color('b')
ax.spines['left'].set_edgecolor('b')
ax.tick_params(axis='y', colors='b')

plt.savefig('test.png')
plt.show()

Actual outcome

test

Expected outcome

All tick labels should be colored

Matplotlib version

  • Operating system: macOS X 10.13.6
  • Matplotlib version: 2.2.2
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.7.0
  • Jupyter version (if applicable): -
  • Other libraries: -

Installed using:

brew install python3
pip3 install matplotlib

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions