word_cloud: Missing parameter contour_width in 1.4.1 (but used in the examples)

Description

I installed from pypi (pip install wordcloud) which results in a version 1.4.1 (as of March 28 2018)

If I run the mask example I get an error: TypeError: __init__() got an unexpected keyword argument 'contour_width'

Steps/Code to Reproduce

Just install from pypi (1.4.1) and run the masked.py example from

Also see line contour_width 29/30 in examples/masked.py source:

wc = WordCloud(background_color="white", max_words=2000, mask=alice_mask,
stopwords=stopwords, contour_width=3, contour_color='steelblue')

And compare the WordCloud __init__ from 1.4.1 where there seems to be no parameter contour_width defined

def __init__(self, font_path=None, width=400, height=200, margin=2,
                 ranks_only=None, prefer_horizontal=.9, mask=None, scale=1,
                 color_func=None, max_words=200, min_font_size=4,
                 stopwords=None, random_state=None, background_color='black',
                 max_font_size=None, font_step=1, mode="RGB",
                 relative_scaling=.5, regexp=None, collocations=True,
                 colormap=None, normalize_plurals=True):

Expected Results

Probably change / adapt the example or add the parameter with a default to 1.4.1

Actual Results

TypeError: __init__() got an unexpected keyword argument 'contour_width'

Versions

Windows-7-6.1.7601-SP1 Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] NumPy 1.14.2 matplotlib 2.2.2 wordcoud 1.4.1

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 19 (8 by maintainers)

Most upvoted comments

I can see how it’s confusing. It’s pretty rare that the examples break, though, and that is the only example that breaks, because it shows off a new feature. The real solution would be to have the documentation rendered for the stable version (including examples) and link to that. That’s on my todo list but I’m pretty busy. Any help is appreciated 😉