Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
word_cloud_est
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
keeleliin
word_cloud_est
Commits
c5e5a390
Commit
c5e5a390
authored
Aug 18, 2015
by
Andreas Mueller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draft of more sensible scaling
parent
ce367f29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
wordcloud/wordcloud.py
wordcloud/wordcloud.py
+4
-2
No files found.
wordcloud/wordcloud.py
View file @
c5e5a390
...
...
@@ -262,12 +262,13 @@ class WordCloud(object):
font_sizes
,
positions
,
orientations
,
colors
=
[],
[],
[],
[]
font_size
=
self
.
max_font_size
last_freq
=
1.
# start drawing grey image
for
word
,
count
in
frequencies
:
for
word
,
freq
in
frequencies
:
# alternative way to set the font size
if
not
self
.
ranks_only
:
font_size
=
min
(
font_size
,
int
(
100
*
np
.
log
(
count
+
100
)))
font_size
=
freq
/
float
(
last_freq
)
*
font_size
while
True
:
# try to find a position
font
=
ImageFont
.
truetype
(
self
.
font_path
,
font_size
)
...
...
@@ -313,6 +314,7 @@ class WordCloud(object):
# recompute bottom right
# the order of the cumsum's is important for speed ?!
occupancy
.
update
(
img_array
,
x
,
y
)
last_freq
=
freq
self
.
layout_
=
list
(
zip
(
frequencies
,
font_sizes
,
positions
,
orientations
,
colors
))
return
self
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment