# Time series - plotting continuous and categorical variable

I have two variables one dependent(Y) and another is independent(X). Y is continuous and X one is categorical. Values of both variables are recorded for every minute, for example 10:00 - X=5, Y=89; 10:01 - X=5, Y=90, 10:02 - X=1, Y=21, 10:03 - X=1, Y=22 (time series). I wanted to explore the variation of Y based on X over a period of one day (1440 minutes).

Would like to know the suitable visualization for this scenario.

Sample data set

Time  - Category - Response
10:00 -     5    -    89
10:01 -     5    -    90
10:02 -     1    -    21
10:03 -     1    -    22
10:04 -     1    -    19
10:05 -     4    -    51
10:06 -     4    -    48

• Time is often, indeed usually, discrete, in years, months. days, whatever. In your case it's minutes and the only real question is how your (unstated) software handles time in minutes. Otherwise the different categories at different times could be represented by different coloured bars or different symbols. That might be a mess, in which separate graphs for separate categories might help. Sep 26, 2014 at 7:38
• ... in which case ... Sep 26, 2014 at 8:18
• Sample data taken is of one day i.e., 1440 data points. Differentiating categories with colors looks impressive. But how? currently using xts function to plot Response across the day Ex: crt <- flx[,c("dt","Respone", "Category")] crxts <- xts(crt[,-1], order.by=crt[,1]) plot.xts(crxts, major.ticks="days", major.format="%b/%d %H:%M", screens=factor(1,1), auto.legend=TRUE, legend.loc="topright", main = "Distribution OUTPUT") Sep 26, 2014 at 9:07
• It's good practice to state your software. If the question is now about precisely what code to use, it's off-topic here. See the Help Center for advice on that. Sep 26, 2014 at 9:13
• Sorry!!! I am using R Sep 26, 2014 at 9:31

 xyplot(Response ~ Time | Category, ...)