How can I create a plot like this?

1 vue (au cours des 30 derniers jours)
Erica Corradi
Erica Corradi le 12 Août 2018
Commenté : jonas le 15 Août 2018
I have a timetable called "Tc1"(attached file) in which, the Column1streamId column contains certain information. I want to create a plot in which in the x axis I put the information of the Column1streamId, in the y axis I put the time (from 12:00 AM to 12:00 AM of the next day). How can I do it?

Réponse acceptée

jonas
jonas le 12 Août 2018
Kind of looks like a scatter plot. You can try this:
%%Load data
data = load('Tc1.mat');
Tc1=data.Tc1;
t=Tc1.t
%%time of day (y)
y=duration([hour(t) minute(t) second(t)])
%%date (x)
x=datetime(year(t),month(t),day(t))
%%color (z)
[z,groups]=findgroups(Tc1.Column1streamId);
scatter3(x,y,z,[],z)
xtickformat('MMM-dd')
view([0 90])
set(gca,'xtick',unique(x))
Obviously it will look more similar when you have more days.
  11 commentaires
Erica Corradi
Erica Corradi le 14 Août 2018
Thanks jonas, it works! Now I'm trying to make it work in my large script, using the Tc table created with the first chart (always made by you).
jonas
jonas le 15 Août 2018
Awesome! Let me know if you run into trouble

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Timetables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by