Defining sub-groups in gscatter

조회 수: 5 (최근 30일)
Matteo Jarre
Matteo Jarre 2016년 3월 1일
댓글: Image Analyst 2017년 6월 17일
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
Mariana
Mariana 2017년 6월 17일
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 2017년 6월 17일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by