setting yscale to log, after drawing a plot with values equal to zero, results in incorrect handling of zero values · Issue #8045 · matplotlib/matplotlib · GitHub
Skip to content

setting yscale to log, after drawing a plot with values equal to zero, results in incorrect handling of zero values #8045

Description

@anntzer

mpl 1.5.3 and 2.0, py3.6

_xs = np.linspace(-50, 50, 1001); plt.semilogy(scipy.stats.norm.pdf(_xs))

results in
figure_1
where zero values (due to floating point resolution limits, at the edges) get ignored, as expected, but

_xs = np.linspace(-50, 50, 1001); plt.plot(scipy.stats.norm.pdf(_xs))
plt.gcf().canvas.draw()
plt.gca().set(yscale="log")

results in the incorrect
figure_2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions