8000 Matplotlib "eats" points when zeros present on logscaled scatter plot · Issue #2872 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Matplotlib "eats" points when zeros present on logscaled scatter plot #2872
Closed
@andrewcollette

Description

@andrewcollette

The following script demonstrates the issue with Matplotlib 1.3.1:

import pylab as plt

X = 5  # set X = 0 and matplotlib drops all later points

data1 = [1,2,3,4,5,6,7,8]
data2 = [1,2,3,4,X,6,7,8]

f = plt.figure(0)
plt.scatter(data1, data2)
plt.xscale('log')
plt.yscale('log')
plt.show()

The problem occurs when using a scatter plot with logscaled axes; if zeros are present in the data, a substantial fraction of the points are discarded. Obviously zeros can't be displayed on a log plot, but I would have expected those points (and only those points) to be silently dropped, or at worst an exception be raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0