Defining sub-groups in gscatter

5 visualizaciones (últimos 30 días)
Matteo Jarre
Matteo Jarre el 1 de Mzo. de 2016
Comentada: Image Analyst el 17 de Jun. de 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 comentarios
Mariana
Mariana el 17 de Jun. de 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 el 17 de Jun. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Descriptive Statistics and Visualization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by