LittleBobbyTables
LittleBobbyTables

Reputation: 4473

Pyplot won't let me create a plot with more than ~7280 points

I'm trying to create a scatterplot with about 10k points:

from random import shuffle
import matplotlib.pyplot as plt

# Dataset of numbers up to 10k
numbers = range(10000)
shuffle(numbers)
xvalues, yvalues = zip(*list(enumerate(numbers)))

plt.scatter(yvalues, xvalues)
plt.xscale("log")
plt.show()

But I get the error:

Assertion failed: (transform_is_valid(m)), function CGMutablePathRef CGPathCreateMutableCopyByTransformingPath(CGPathRef, const CGAffineTransform *), file Paths/CGPath.cc, line 168. Abort trap: 6

If I reduce the number of points to around 7284 it works though!

xvalues, yvalues = zip(*list(enumerate(numbers[:7284])))

Why?

Upvotes: 1

Views: 52

Answers (1)

eyllanesc
eyllanesc

Reputation: 244369

You need to upgrade your version of matplotlib

Upvotes: 1

Related Questions