I am just trying to plot a simple wordcloud of grades which has a grade string, say,
grade='DBBBDBEFBFFASBCBABCCSBCAABBCBACDBFDBAFDAACAFAACABBFABCBAACF'
when I plot it using,
>>wordcloud(grade)
the function removes all Grade A information. How do I include the grade A in the plot?

댓글 수: 7

Greg
Greg 2018년 11월 28일
편집: Greg 2018년 11월 28일
Can you be more specific? What is a "stopword?" What is Grade A? Do you mean specifically occurrences of the letter "A" disappear? This is not the behavior I'm seeing. What release are you using?
For me, I see nothing when the number of characters in a word is more than about 40. What result are you expecting to see?
Lairenlakpam Joyprakash Singh
Lairenlakpam Joyprakash Singh 2018년 11월 28일
편집: Lairenlakpam Joyprakash Singh 2018년 11월 28일
Hello Mr. Greg, Thank you for the comment. Actually I was trying to plot a wordcloud of grades obtained by students of a class of size, say 59 students. I am using Matlab's in-built wordcloud function which I believ automatically removes few characters like prepositions: a, the, of etc. including special characters under a tag called "stopword". In fact, I used a simple command as mentioned above which gives the following output:
and at the command window:
ans =
WordCloudChart with properties:
WordData: ["B" "C" "F" "D" "E" "S"]
SizeData: [18 10 8 5 1 1]
MaxDisplayWords: 100
In the output, information of Grade A has been removed automatically by the function. I want it to be included.
Greg
Greg 2018년 11월 28일
편집: Greg 2018년 11월 28일
What release are you using, and is this core MATLAB or Text Analytics Toolbox? I am not getting anything near that behavior.
jonas
jonas 2018년 11월 28일
편집: jonas 2018년 11월 28일
I don't think the wordcloud function recognizes different characters like that. You probably did not provide the full code? If you add a space between each grade, then I can verify that the A goes missing, for unknown reason. Odd.
My guess would be that the function wordCloudCounts does not count 'a', as you would normally prefer to have single characters excluded from your wordcloud?
Lairenlakpam Joyprakash Singh
Lairenlakpam Joyprakash Singh 2018년 11월 28일
편집: Lairenlakpam Joyprakash Singh 2018년 11월 28일
As far as I know, the wordcloud function normally does not count the prepositions. I believe since the alphabet A is a preposition, the count for this letter does not happen. Just guessing, else it should have counted all letters in the first place.
Hence, I am looking for a possible solution to count this letter or any specific letter or a word in general. It would solve the issue.
Greg
Greg 2018년 11월 29일
As in Guillaume's answer, the key missing piece in the original post is the transpose. Given:
grade='DBBBDBEFBFFASBCBABCCSBCAABBCBACDBFDBAFDAACAFAACABBFABCBAACF';
The following does not work:
wordcloud(grade);
But the transpose does ("work" meaning create a word cloud, but with "A" removed):
wordcloud(grade');
Function takes column matrix. That's why!

댓글을 달려면 로그인하십시오.

 채택된 답변

Guillaume
Guillaume 2018년 11월 28일
편집: Guillaume 2018년 11월 28일

0 개 추천

Bear in mind that this is with base matlab. The text analytics toolbox, which I don't have, may have some better ways of doing what you want.
I'm simply converting your char array into a categorical array. It doesn't look like wordcloud does any filtering on categorical arrays:
grade='DBBBDBEFBFFASBCBABCCSBCAABBCBACDBFDBAFDAACAFAACABBFABCBAACF'
wordcloud(categorical(cellstr(grade')))
displays

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Display and Presentation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by