How to choose specific countries and plot graph?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Here is my dataset

I want to plot multiple countries Confirmed Cases. So how to choose countries and plot a bar graph?
採用された回答
Cris LaPierre
2020 年 6 月 28 日
You'll have to get the data into MATLAB first. I suggest using the import tool. This video may be helpful for that.
11 件のコメント
Saurav Karmakar
2020 年 6 月 29 日
Without using any tool, can you help me with the code?
Cris LaPierre
2020 年 6 月 29 日
Use the tool to generate the code you need. This video on generating and reusing code created by the import tool shows you how.
Saurav Karmakar
2020 年 6 月 29 日
It worked but I want Countries to be x-axis and cases to be y-axis use them to plot Bar-Plot but it's not showing. I want to get cummlative Confirmed Cases for China and plot it as a Bar and same thing for rest countries also. How can I do that?

Cris LaPierre
2020 年 6 月 29 日
編集済み: Cris LaPierre
2020 年 6 月 29 日
Click the circular arrow icon between your two variables to swap X and Y data.
If you want to create counts by category (country here), you'll need to use the groupsummary function. This video might help you with learning how to use it.
Just an observation. You might consider enrolling in our Exploratory Data Analysis with MATLAB course on Coursera. That is where all these videos are coming from. It is free to enroll if you don't mind skipping the graded content.
Saurav Karmakar
2020 年 6 月 29 日
I wrote this code instead.

And when I sort it by Desciding Confirmed Cases it doesn't work

I have knowledge of EDA but in Python that's I'm having problem in MATLAB
Cris LaPierre
2020 年 6 月 29 日
編集済み: Cris LaPierre
2020 年 6 月 29 日
Thanks, I got my solution. I then sliced the data using this code
top10 = country_clean_sorted(1:10,:);
And now the plot is

Cris LaPierre
2020 年 6 月 29 日
Now I suggest looking into the function removecats. It will allow you to remove the categories with zero counts. That can help make the bar plot easier to interpret.
Saurav Karmakar
2020 年 6 月 29 日
編集済み: Saurav Karmakar
2020 年 6 月 29 日

What to do?
top10.Country = removecats(top10.Country);
Saurav Karmakar
2020 年 6 月 29 日
Thanks a lot Cris! I learned a lot today.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Orange についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
