Commit 262c6ac2 authored by Andreas Mueller's avatar Andreas Mueller

update examples, docs.

parent 0808721e
......@@ -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="...">
......
......@@ -16,6 +16,7 @@ All functionality is encapsulated in the WordCloud class.
:template: class.rst
WordCloud
ImageColorGenerator
:template: function.rst
......
......@@ -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

159 KB | W: | H:

examples/alice.png

139 KB | W: | H:

examples/alice.png
examples/alice.png
examples/alice.png
examples/alice.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment