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');
Lairenlakpam Joyprakash Singh
Lairenlakpam Joyprakash Singh 2018 年 11 月 29 日
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

1 件のコメント

Lairenlakpam Joyprakash Singh
Lairenlakpam Joyprakash Singh 2018 年 11 月 29 日
This is what I was looking for. Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDisplay and Presentation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by