laserson / squarify

Pure Python implementation of the squarify treemap layout algorithm
Other
298 stars 37 forks source link

matplotlib `text()` throws error #27

Closed ndrc-pizzimenti closed 3 years ago

ndrc-pizzimenti commented 3 years ago

Using the most recent version, here's a MWE:

import squarify as sq

data = [1, 2, 3]
labels = ["1", "2", "3"]
sq.plot(sizes=data, label=labels)

This throws the error

Traceback (most recent call last):
  File "/Users/nraf1041/Desktop/charting/test/test_competitive.py", line 6, in <module>
    competitive(dpis)
  File "/Users/nraf1041/Desktop/charting/charting/partisan/competitive.py", line 59, in competitive
    sq.plot(sizes=data, label=labels)
  File "/Users/nraf1041/.pyenv/versions/3.8.2/lib/python3.8/site-packages/squarify/__init__.py", line 268, in plot
    ax.text(x + dx / 2, y + dy / 2, l, va=va, ha="center", **text_kwargs)
TypeError: text() missing 1 required positional argument: 's'
ndrc-pizzimenti commented 3 years ago

Was an issue with competing axes objects.