Defining sub-groups in gscatter

5 vues (au cours des 30 derniers jours)
Matteo Jarre
Matteo Jarre le 1 Mar 2016
Commenté : Image Analyst le 17 Juin 2017
Hello everybody,
I'm having troubles in correctly using the "gscatter" function; I have three variables 'temp' (a temperature), 'en' (energy) and 'hour' (the hour of the day at which the energy was consumed, given for many different days).
I am able now to use gscatter to plot 'temp' vs. 'en' and visualize the different hours as different colors by simply using
gscatter(temp_h,en,hour);
Since there are 24 hours in a day, the visualization is not optimal. What I now would like to do is to create sub-groups of hours that could be plotted in a single color, e.g. '0 am to 4 am', '5 am to 9 am' and so on...
How could I define such subgroups and have them correctly read by 'gscatter' function? I really can't do this also considering that the third variable of gscatter should have the same length of the two other variables.
Thanks a lot in advance.
All the best.
Matteo
  2 commentaires
Mariana
Mariana le 17 Juin 2017
I do have same question. How can I add a colorbar that range, for example, from 0 to 24 hours, in case on the example above. I would appreciate help soon :)
Image Analyst
Image Analyst le 17 Juin 2017
Attach a small sample of your data. Failing to do that, or at least posting a screenshot, may be why no one answered the original question.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Descriptive Statistics and Visualization 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