Python 단순 실현 어 클 라 우 드 코드 및 절차 분석
pip install wordcloud
2.가방 을 불 러 오고 경 로 를 설정 합 니 다.
import os
from wordcloud import WordCloud
import matplotlib.pyplot as plt
os.chdir('E:\\pyspace\\tmp')
3.단어 구름 그림 예제1.기본 매개 변수 예제
text = 'Keep it simple and stupid.'
wc = WordCloud() #
wc.generate(text) #
plt.imshow(wc) #
주 피 터 에 그래 픽 출력 이 없 으 면 주 피 터 의 그래 픽 디 스 플레이 방식 을 설정 해 야 합 니 다.
%matplotlib inline
WordCloud()단어 구름 그림 대상 에 대응 하 는 캔버스 는 기본 길이 200 픽 셀,너비 400 픽 셀,배경 색 은 검은색 입 니 다.2.설정 매개 변수 예제
text = 'Keep it simple and stupid.'
wc = WordCloud(background_color='white', width=500, height=300) #
wc.generate(text) #
plt.imshow(wc) #
3.좌표 축 보이 지 않 음
text = 'Keep it simple and stupid.'
wc = WordCloud(background_color='white', width=500, height=300) #
wc.generate(text) #
plt.imshow(wc) #
plt.axis('off') #
plt.show()
환경 설명:
이상 이 바로 본 고의 모든 내용 입 니 다.여러분 의 학습 에 도움 이 되 고 저 희 를 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Python의 None과 NULL의 차이점 상세 정보그래서 대상 = 속성 + 방법 (사실 방법도 하나의 속성, 데이터 속성과 구별되는 호출 가능한 속성 같은 속성과 방법을 가진 대상을 클래스, 즉 Classl로 분류할 수 있다.클래스는 하나의 청사진과 같아서 하나의 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.