网站开发有几种,深圳网站制作长沙,做网站起什么题目,全国备案网站数量wordcloud-1.9.1开始无法在python3.6和海龟编辑器内正常使用#xff0c;特做了一个whl 提供给python3.6使用。
另外我自己使用Python3.8 #xff0c;因此wordcloud-1.9.2-cp36-cp36-win_amd64.whl 和wordcloud-1.9.3-cp38-cp38-win_amd64.whl#xff0c;词云图上有前20个单…wordcloud-1.9.1开始无法在python3.6和海龟编辑器内正常使用特做了一个whl 提供给python3.6使用。
另外我自己使用Python3.8 因此wordcloud-1.9.2-cp36-cp36-win_amd64.whl 和wordcloud-1.9.3-cp38-cp38-win_amd64.whl词云图上有前20个单词的频次。
使用效果如图 修改代码wordcloud.py def to_image(self):self._check_generated()if self.mask is not None:width self.mask.shape[1]height self.mask.shape[0]else:height, width self.height, self.widthxint(width * self.scale)yint(height * self.scale)#高和宽280、200,多出的像素用于存放单词频次img Image.new(self.mode, (x280,y220),self.background_color)draw ImageDraw.Draw(img)jishu-1words1for (word, count), font_size, position, orientation, color in self.layout_:jishujishu1font ImageFont.truetype(self.font_path,int(font_size * self.scale))font1 ImageFont.truetype(self.font_path,20) transposed_font ImageFont.TransposedFont(font, orientationorientation)transposed_font1 ImageFont.TransposedFont(font1, orientationorientation)pos (int(position[1] * self.scale),int(position[0] * self.scale))draw.text(pos,word,fillcolor,fonttransposed_font)if jishu21 and x400:words1words1 word..str(int(count))if jishu % 54:words1words1.strip()draw.text((0,yjishu*5),words1,fillred,fontfont1)words1return self._draw_contour(imgimg)