Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'ImageDraw' object has no attribute 'textsize' #780

Open
2107020215 opened this issue Nov 14, 2024 · 0 comments
Open

AttributeError: 'ImageDraw' object has no attribute 'textsize' #780

2107020215 opened this issue Nov 14, 2024 · 0 comments

Comments

@2107020215
Copy link

---> 23 wordcloud.generate_from_frequencies(word_frequencies)
25
26 plt.figure(figsize=(10, 5))

File c:\Users\lxt\anaconda3\lib\site-packages\wordcloud\wordcloud.py:453, in WordCloud.generate_from_frequencies(self, frequencies, max_font_size)
451 font_size = self.height
452 else:
--> 453 self.generate_from_frequencies(dict(frequencies[:2]),
454 max_font_size=self.height)
455 # find font sizes
456 sizes = [x[1] for x in self.layout_]

File c:\Users\lxt\anaconda3\lib\site-packages\wordcloud\wordcloud.py:508, in WordCloud.generate_from_frequencies(self, frequencies, max_font_size)
505 transposed_font = ImageFont.TransposedFont(
506 font, orientation=orientation)
507 # get size of resulting text
--> 508 box_size = draw.textsize(word, font=transposed_font)
509 # find possible places using integral image:
510 result = occupancy.sample_position(box_size[1] + self.margin,
511 box_size[0] + self.margin,
512 random_state)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant