X Tutup
Skip to content

Log Scale Ticklabels Refuse to Die (Data Dependent) #8027

@riggsd

Description

@riggsd

Bug report

When setting a scatter plot's y axis to log-scale in matplotlib 2.0.0, it is data dependent as to whether y tick labels can be removed or not.

Code for reproduction

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np

# create fake data
MIN, MAX = 13, 100
y = np.linspace(MIN, MAX, num=50)
x = np.arange(len(y))

# plot it
fig = plt.figure()
fig.suptitle('matplotlib %s  (range %d - %d)' % (mpl.__version__, MIN, MAX))
plot = fig.add_subplot(111)
plot.scatter(x, y)
plot.set_yscale('log')  # set log-scale y axis
plot.set_yticks([])     # disable y ticklabels (FIXME: silent failure on mpl 2.0.0)
plt.show()

Actual outcome

This animation illustrates driving the above code, starting with values 1-100, up to values 20-100. Note that y ticklabels are successfully removed for lower values, then the ticklabels appear for minimum y values of 13 and above.

mpl_log_test_2 0 0_anim

Note that I've tried several different approaches to remove the y ticklabels, but the labels always reappear given certain input data. Even when I set my own ScalarFormatter() for custom labeling (which is my real goal), the default scientific notation labels are still rendered "on top of" my own labels.

Expected outcome

Expected outcome is that y ticklabels would never appear, regardless of the values being plotted.

Matplotlib version

  • matplotlib 2.0.0 (bug is not present in 1.5.3)
  • Mac OS X 10.9.5
  • python.org Python 2.7.13
  • all dependencies installed using pip

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

      X Tutup