先来看看效果图

import wordcloud
import jieba
from scipy.misc import imread
import matplotlib.pyplot as plt#基础版
txt="Effects of a leukemia-associated gain-of-function mutation of SHP-2 phosphatase on interleukin-3 signaling.\nMutations in SHP-2 phosphatase that cause hyperactivation of its catalytic activity have been identified in human leukemias, particularly juvenile myelomonocytic leukemia, which is characterized by hypersensitivity of myeloid progenitor cells to granulocyte macrophage colony-stimulating factor and interleukin (IL)-3. However, the molecular mechanisms by which gain-of-function (GOF) mutations of SHP-2 induce hematopoietic malignancies are not fully understood. Our previous studies have shown that SHP-2 plays an essential role in IL-3 signal transduction in both catalytic-dependent and -independent manners and that overexpression (5-6-fold) of wild type (WT) SHP-2 attenuates IL-3-mediated hematopoietic cell function through accelerated dephosphorylation of STAT5. These results raised the possibility that SHP-2-associated leukemias are not solely attributed to the increased catalytic activity of GOF mutant SHP-2. GOF mutant SHP-2 must have gained additional capacities. To test this possibility, we investigated effects of a GOF mutation of SHP-2 (SHP-2 E76K) on hematopoietic cell function and IL-3 signal transduction by comparing with those of overexpressed WT SHP-2. Our results showed that SHP-2 E76K mutation caused myeloproliferative disease in mice, while overexpression of WT SHP-2 decreased hematopoietic potential of the transduced cells in recipient animals. The E76K mutation in the N-terminal Src homology 2 domain increased interactions of mutant SHP-2 with Grb2, Gab2, and p85, leading to hyperactivation of IL-3-induced Erk and phosphatidylinositol 3-kinase (PI3K) pathways. In addition, despite the substantial increase in the catalytic activity, dephosphorylation of STAT5 by SHP-2 E76K was dampened. Furthermore, catalytically inactive SHP-2 E76K with an additional C459S mutation retained the capability to increase the interaction with Gab2 and to enhance the activation of the PI3K pathway. Taken together, these studies suggest that in addition to the elevated catalytic activity, fundamental changes in physical and functional interactions between GOF mutant SHP-2 and signaling partners also play an important role in SHP-2-related leukemigenesis."
w=wordcloud.WordCloud()
w.generate(txt)
w.to_file("pywc.png")#美化版
mk=plt.imread("beauty.jpg")#选择一张好看的背景图片
img_colors=wordcloud.ImageColorGenerator(mk)#改变生成文字颜色
txt='''武汉 (湖北省省会、副省级市)武汉,简称“汉”,别称江城,是湖北省省会、副省级市,中国中部地区的中心城市,全国重要的工业基地、科教基地和综合交通枢纽 ,中央军委联勤保障部队驻地。截至2018年,武汉市下辖13个区,总面积8494.41平方千米,
建成区面积628平方千米,常住人口1108.1万人,城镇人口889.69万人,城镇化率80.2%,是中国中部六省唯一的特大城市。武汉地处江汉平原东部、长江中游,长江及汉江横贯市境中央,将武汉中心城区一分为三,形成武汉三镇隔江鼎立的格局。武汉江河纵横、湖
泊众多,水域面积约占全市总面积四分之一。武汉有“九省通衢”之称,是中国内陆最大的水陆空交通枢纽、长江中游航运中心,其高铁网辐射大半个中国,是华中地区唯一可直航全球五大洲的城市。武汉是国家历史文化名城。盘龙城遗址是武汉建城史的开端,有3500
年历史。春秋战国以来,武汉长期是中国南方的军事商贸重镇。明清时期的汉口被称为“天下四聚”之一。19世纪末汉口开埠和洋务运动,促进了武汉的城市现代化进程,汉口成为全国重要的经济中心,汉阳成为中国近代工业文明发祥地之一  ,武昌兴办教育,武昌起
义是辛亥革命的开端,成为中国民主革命的发祥地。三镇于1927年首次合并 。2016年3月,《长江经济带发展规划纲要》将武汉列为超大城市;12月,国家发改委明确要求武汉加快建成以全国经济中心、高水平科技创新中心、商贸物流中心和国际交往中
心四大功能为支撑的国家中心城市。2019年10月,第七届世界军人运动会将在武汉举行。'''
w=wordcloud.WordCloud(width=1000,color_func=img_colors,stopwords=['城市','全国','国家','总面积','平方千米','唯一'],mask=mk,font_path="msyh.ttc",height=700)#微软雅黑字体
w.generate(" ".join(jieba.lcut(txt)))#jieba库分词,因为wordcloud以空格分词
w.to_file('pywc1.png')


更多详细参见https://blog.csdn.net/fly910905/article/details/77763086

wordcloud生成词云相关推荐

  1. python应用学习(四)——wordcloud生成词云

    python应用学习(四)--wordcloud生成词云 前言 一.准备 二.导入库 三.基本功能实现 四.爬取书评并制作词云 最后 前言 朋友最近在公众号发一些好书好剧推荐,然后我想着帮帮忙,做一个 ...

  2. java使用wordcloud生成词云

    1.引入maven依赖 <dependency><groupId>com.kennycason</groupId><artifactId>kumo-co ...

  3. python——读取docx文档wordcloud生成词云并进行词频统计

    文章目录 环境准备 导入库 读取docx并进行分词 词频 词云 设置背景图片(可选) 生成词云 保存词云并显示 环境准备 # 不是docx,是python-docx!!!!!!! pip instal ...

  4. 拿来就用能的Python词云图代码|wordcloud生成词云详解

    词云也叫文字云,是一种可视化的结果呈现,常用在爬虫数据分析中,原理就是统计文本中高频出现的词,过滤掉某些干扰词,将结果生成一张图片,直观的获取数据的重点信息.今天,我们就来学习一下Python生成词云 ...

  5. python中wordcloud生成词云_python使用WordCloud生成词云

    前言 当我们想快速了解 书籍.小说.电影剧本中的内容是时,则可以采用绘制 WordCloud 词云图,显示主要的关键词,可以非常直观的看到结果 核心代码 from wordcloud import W ...

  6. java怎么画词云_Matplotlib学习---用wordcloud画词云(Word Cloud)

    画词云首先需要安装wordcloud(生成词云)和jieba(中文分词). 先来说说wordcloud的安装吧,真是一波三折.首先用pip install wordcloud出现错误,说需要安装Vis ...

  7. python制作中文词云_Python如何生成词云(详解)

    前言 今天教大家用wrodcloud模块来生成词云,我读取了一篇小说并生成了词云,先看一下效果图: 效果图一: 效果图二: 根据效果图分析的还是比较准确的,小说中的主人公就是"程理" ...

  8. python生成的词云没有图案_Python如何生成词云的方法

    这篇文章主要介绍了关于Python如何生成词云的方法,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下 前言 今天教大家用wrodcloud模块来生成词云,我读取了一篇小说并生成了词云,先 ...

  9. html生成word附带图片_生成词云的几种方式对比

    在数据可视化方面,词云一直是一种视觉冲击力很强的方式.对输入的一段文字进行语义分割,得到不同频度的词汇,然后以正比于词频的字体大小无规则的集中显示高频词,简洁直观高效. 词云虽好,但也要易做才行.本文 ...

最新文章

  1. 3层,5层,7层,9层网络性能比较-0-2
  2. 最大正数pascal程序
  3. es6 --- 使用yield*命令遍历完全二叉树
  4. Github pull request 工作流总结
  5. linux ruby作用域,细说Ruby细化
  6. BZOJ 1020 安全的航线flight
  7. stm32g474教程_(完整版)STM32F103通用教程
  8. 【工具】之搭建个人博客
  9. linux下编写sql脚本,在Linux系统中编写简易shell脚本,向PLSQL表中插入数据
  10. js Promise理解,同时请求多个接口等
  11. 蓝牙模块四大天线方式
  12. 7个最优秀的手机游戏引擎
  13. 索尼电视总出现Android,索尼BRAVIA电视推送更新:升级安卓8.0,修复众多问题
  14. java文件上传与下载
  15. 苹果CMS10 影视模板程序源码
  16. 四级资料免费分享 【写作万能模板 + 听力高频词 + 核心500词 + 翻译必备句型 + 作文对策】 点个关注即可全部拿走!!!
  17. PDF转Word文字可编辑的软件有哪些?
  18. Stata: 断点回归 (RDD) 中的平滑性检验
  19. 数字信号处理实践方法 第二版 笔记
  20. Oracle函数篇 - pivot行转列函数

热门文章

  1. Android学习——VAP源码
  2. lazarus研究--基础数据类型
  3. linux下网卡bonding配置
  4. Java利用继承和多态来求矩形、正方形和圆形的面积与周长
  5. 交流变频电源变压器如何检查维修呢?
  6. VSCode使用便利贴
  7. 解决Foxmail新增邮箱报错问题
  8. Ubuntu 22.10 下好用的 GNOME Shell 扩展
  9. screen 命令基本操作教程
  10. Java实现用户注册和登录