Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
word_cloud_est
Commits
accb5d32
Commit
accb5d32
authored
Jan 12, 2017
by
Andreas Mueller
Browse files
allow horizontal-only word-clouds.
parent
153a0eca
Changes
1
Hide whitespace changes
Inline
Side-by-side
wordcloud/wordcloud.py
View file @
accb5d32
...
...
@@ -165,6 +165,9 @@ class WordCloud(object):
prefer_horizontal : float (default=0.90)
The ratio of times to try horizontal fitting as opposed to vertical.
If prefer_horizontal < 1, the algorithm will try rotating the word
if it doesn't fit. (There is currently no built-in way to get only vertical
words.)
mask : nd-array or None (default=None)
If not None, gives a binary mask on where to draw words. If mask is not
...
...
@@ -440,7 +443,8 @@ class WordCloud(object):
# either we found a place or font-size went too small
break
# if we didn't find a place, make font smaller
if
tried_other_orientation
is
False
:
# but first try to rotate!
if
not
tried_other_orientation
and
self
.
prefer_horizontal
<
1
:
orientation
=
(
Image
.
ROTATE_90
if
orientation
is
None
else
Image
.
ROTATE_90
)
tried_other_orientation
=
True
...
...
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