Can anyone give an idea on how to make this type of plot?

6 件のコメント

TADA
TADA 2018 年 11 月 5 日
Do you have a dataset for example?
Hari krishnan
Hari krishnan 2018 年 11 月 6 日
Yes, the data set and the sample code i wrote to make this plot is attached. But i am not able to get the desired result. I am getting an error using gscatter.
for_time_series_data = 'for_time_series_events_all_data_14.076.xlsx';
read_time_series_data = readtable(for_time_series_data);
x = read_time_series_data.entryTime;
y = read_time_series_data.nestType;
group = {read_time_series_data.decision time recruitment
,read_time_series_data.time of visit
};
gscatter(x,y,group,'rkgb','o*',8,'on','entryTime','nestType');
TADA
TADA 2018 年 11 月 6 日
編集済み: TADA 2018 年 11 月 6 日
first of all the spaces in
read_time_series_data.decision time recruitment
and
read_time_series_data.time of visit
are not valid
second you are trying to send a string cell array in y to gsatter, and according to the documentation it expects a numeric vector.
So you will have to parse that '# lax' string to get the number
Hari krishnan
Hari krishnan 2018 年 11 月 6 日
@TADA, i didnot understand much
Hari krishnan
Hari krishnan 2018 年 11 月 6 日
Hi TADA, thank you. I was able to do.
TADA
TADA 2018 年 11 月 6 日
Cheers
good luck!

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

 採用された回答

the cyclist
the cyclist 2018 年 11 月 5 日

0 投票

You could use the plot command.
You could use the scatter command.
Take a look at the MATLAB Plot Gallery to steal code for these or other plot styles.

1 件のコメント

Hari krishnan
Hari krishnan 2018 年 11 月 6 日
編集済み: Hari krishnan 2018 年 11 月 6 日
Hi, thank you for the suggestion. I tried to use 'gscatter'. But i am not able to get the desired output. Can you help me with this? Code and sample data is attached above.

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

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2018 年 11 月 5 日

コメント済み:

2018 年 11 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by