Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Font family is not set on log-scaled tick labels #8017

Closed
@michael-a-hansen

Description

@michael-a-hansen

Bug report

Bug summary

Setting the font family through rcParams doesn't impact tick labels if the axis is log-scaled. The size of the font can be changed, but not the family (e.g. using the serif font).

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib import rcParams

rcParams['font.family'] = 'serif'
rcParams['font.size'] = 16

x = [0, 1, 2]
y = [1, 100, 10000]

plt.plot(x, y)
plt.yscale('log')
plt.savefig('logscaled.png')
plt.clf()

plt.plot(x, y)
plt.savefig('not-logscaled.png')

Actual outcome

As seen in this screenshot, the linear-scaled y-axis on the left has a serif font while the log-scaled y-axis on the right still has the default sans-serif font. In both cases the font size is set appropriately to 16. It's just the font family that doesn't change. (Pardon the 'shadow' between the two images, that's my Mac, not matplotlib).

issue

Expected outcome

The code should produce tick labels on log-scaled axes with the specified font family.

Matplotlib version

  • Mac OS X 10.10.5
  • python 3.5, installed from a Mac installer pkg
  • matplotlib 2.0.0 - upgraded February 3 with python3 -m pip install --upgrade matplotlib

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.topic: text

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions