Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
word_cloud_est
Commits
262c6ac2
Commit
262c6ac2
authored
Apr 29, 2015
by
Andreas Mueller
Browse files
update examples, docs.
parent
0808721e
Changes
5
Hide whitespace changes
Inline
Side-by-side
doc/index.rst
View file @
262c6ac2
...
...
@@ -25,6 +25,11 @@
<img src="_images/masked_1.png" alt="...">
</a>
</div>
<div class="col-xs-3 col-md-3">
<a href="auto_examples/colored.html" class="thumbnail">
<img src="_images/colored_2.png" alt="...">
</a>
</div>
<div class="col-xs-3 col-md-3">
<a href="auto_examples/a_new_hope.html" class="thumbnail">
<img src="_images/a_new_hope_1.png" alt="...">
...
...
doc/references.rst
View file @
262c6ac2
...
...
@@ -16,6 +16,7 @@ All functionality is encapsulated in the WordCloud class.
:template: class.rst
WordCloud
ImageColorGenerator
:template: function.rst
...
...
examples/a_new_hope.py
View file @
262c6ac2
...
...
@@ -13,7 +13,7 @@ import random
from
wordcloud
import
WordCloud
,
STOPWORDS
def
grey_color_func
(
word
,
font_size
,
position
,
orientation
,
random_state
=
None
):
def
grey_color_func
(
word
,
font_size
,
position
,
orientation
,
random_state
=
None
,
**
kwargs
):
return
"hsl(0, 0%%, %d%%)"
%
random
.
randint
(
60
,
100
)
d
=
path
.
dirname
(
__file__
)
...
...
examples/alice.png
View replaced file @
0808721e
View file @
262c6ac2
159 KB
|
W:
|
H:
139 KB
|
W:
|
H:
2-up
Swipe
Onion skin
examples/colored.py
View file @
262c6ac2
...
...
@@ -31,13 +31,11 @@ image_colors = ImageColorGenerator(alice_coloring)
# show
plt
.
imshow
(
wc
)
plt
.
title
(
"original"
)
plt
.
axis
(
"off"
)
plt
.
figure
()
# recolor wordcloud and show
# we could also give color_func=image_colors directly in the constructor
plt
.
imshow
(
wc
.
recolor
(
color_func
=
image_colors
))
plt
.
title
(
"recolored"
)
plt
.
axis
(
"off"
)
plt
.
figure
()
plt
.
imshow
(
alice_coloring
,
cmap
=
plt
.
cm
.
gray
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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