Skip to content
Advertisement

matplotlib log scales causes missing points

I’m having a really strange issue with matplotlib. Plotting some points looks like this:

regulargraph

When I switch to a log scale on the y-axis, some of the points are not connected:

logscale

Is this a bug? Am I missing something? Code is below. Comment out the log scale line to see the first graph.

JavaScript

Advertisement

Answer

log(0) is undefined. I’m guessing matplotlib just ignores the NaNs which crop up here.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement