title: How to increase max_words in Word-cloud using python?
body: <p>I am using the word cloud implementation using using <a href="https://github.com/amueller/word_cloud" rel="nofollow noreferrer">word cloud generator</a>.</p>
  
  <p>Here is the code I have written, which is similar to that of the example they provided.</p>
  
  <pre><code>from os import path
  from scipy.misc import imread
  import matplotlib.pyplot as plt
  import random
  
  from wordcloud import WordCloud, STOPWORDS
  
  
  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__)
  
  
  with open("sample.csv") as f:
      lines = f.readlines() 
  text = "".join(lines)
  f.close()
  
  stopwords = STOPWORDS.copy()
  
  
  
  wc = WordCloud(max_words=15156633, stopwords=stopwords, margin=10,random_state=1).generate(text)
  # generate_from_frequencies()
  default_colors = wc.to_array()
  plt.title("Custom colors")
  plt.imshow(wc.recolor(color_func=grey_color_func, random_state=3))
  wc.to_file("wordcloud_figure.png")
  plt.axis("off")
  plt.figure()
  plt.title("Default colors")
  plt.imshow(default_colors)
  plt.axis("off")
  plt.show()
  </code></pre>
  
  <p>And the output I got is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/T8jm0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T8jm0.png" alt="Word cloud generated"></a></p>
  
  <p>Irrespective of the "max_words" (whether I increase or decrease) of the <code>WordCloud()</code> function, I am seeing almost no effect on the final putput.</p>
  
  <p>What could be wrong?</p>
  
  <p>Also, how to use the <code>generate_from_frequencies()</code> method which is mentioned in the <a href="http://amueller.github.io/word_cloud/generated/wordcloud.WordCloud.html#wordcloud.WordCloud.generate_from_frequencies" rel="nofollow noreferrer">API reference</a>.</p>