how to plot time points in a day on excel - excel

I have a set of points as time of day like
05:36:37
06:31:41
06:38:24
06:39:42
07:03:47
07:04:18
07:09:28
07:28:40
07:29:20
07:29:49
07:31:57
.....
Now i would like to plot this for an entire 24 hour range in a day.
Basically x axis is the 24 hour range and i need a point for every above time on the y axis. ofcourse y axis may not vary, but i am loooking at finding the coverage as to, in a day, when did the even occur more times. Its the same event. If there are better ways to represent you can also suggest that.

Let's say your data is from A1 to A_N.
in column B enter =HOUR(A1)
in column C enter =MINUTE(A1)
Then Insert -> XY Scatter Chart

Related

create stacked column chart to show running time

I have data on 5 runners for 1 week; start time and end time in a race. I want to graph how long it took each runner to finish the race
when I subtract the cells for start and end time, I get a result as 3:00 AM instead of 3 hours. I think this is why I'm having an issue creating a stacked column chart
how can I subtract 2 timestamps and get it to spit out just the hours instead of another time stamp?
I want the date on x axis and time to complete the race on y axis
thank you
here is a sample of the data
https://imgur.com/xRyDynl
i want a stacked column chart that has dates on the x axis. so 1/1 will have 1 bar that has 30 mins for racer 1, 35mins for 2, and 40 mins for 3

How to make a categorical count bar plot with time on x-axis

I want to count the number of occurrences of categories in a variable and plot it against time.
The data looks like following:
Date_column Categorical_variable
20-01-2019 A
20-01-2019 B
20-01-2019 C
21-01-2019 A
21-02-2019 A
22-02-2019 B
........................
23-04-2020 A
I want to show that in month of Jan I had 1 occurrence of B/C whereas 2 occurrences of A. In feb, I had 1 occurrence of A/B and so on. The bar plots can be stacked to know the total number of occurrences.
I've been very close to it. But haven't been able to draw plot out of it.
df['Date_column'].groupby([df.Date_column.dt.year, df.Date_column.dt.month]).agg('count')
The other way is to change the dates to 1st of every month, and then group by to count a occurence. But I'm unable to draw plot out of it.
df.groupby(df['Date_column'], df['Categorical_variable']).count()
Use crosstab with Series.dt.to_period:
df['Date_column'] = pd.to_datetime(df['Date_column'])
df = pd.crosstab(df['Date_column'].dt.to_period('m'), df['Categorical_variable'])
df.plot.bar()

Find a temperature and work out how long it remained >= this temperature

I have an excel sheet with times in one column and temperatures in another. I'm trying to work out a formula that will find a certain temperature and measure how long it remained at that temperature.
11:25:29 AM 69.3°C
11:26:29 AM 69.6°C
11:27:29 AM 69.8°C
11:28:29 AM 70.0°C
11:29:29 AM 70.2°C
11:35:29 AM 70.8°C
11:36:29 AM 70.3°C
11:37:29 AM 69.5°C
11:38:29 AM 68.5°C
11:39:29 AM 67.5°C
12:39:29 PM 66.3°C
1:39:29 PM 52.1°C
2:39:29 PM 12.1°C
3:39:29 PM 5.0°C
In this example, I would like to find when it hit 70.0°C and how long it stayed above 70.0°C.
This is a bit of a tough problem because you might have multiple occasions where you go above 70 degrees. In that case, do you want the total time spent above 70 in the entire dataset, or do you want the total time spent above 70 consecutively? And then, how are you determining which of these potential multiple nonconsecutive periods you are talking about?
That said, you can try this. If column A is your datetime, and column B is your temp reading, specify another cell as your temperature reference value ($D$1 here), and in column C starting in row 2 do this:
=(A2-A1)*IF(B2>=$D$1,1,0)
and then copy that all the way down. What that does is it calculates the time difference between measurements and then if the temperature at that time is greater than your reference, it multiplies it by 1, otherwise it multiplies by 0. Because a date/time in Excel is really just a number, what you get is an interval of a day between measurements in each cell of column C. In other words, .25 = 6 hours.
Now that you have that data in column C, you are free to further parse it. You can use a simple SUM(C:C) formula in a cell, or you can go back and sum up individual ranges. I hope this helps.

Plotting time on X axis in excel

I have done 24 hour measurement and results obtain contains around 1400 entries. Now I want to plot those results in such a way
That x axis represent my time and y axis the corresponding value.
My x axis should be divided into 24 sections each representing 1
hour.
My exact start time is 14:00 and end time is next day 14:00.
For more clarification I am adding a simple version of my data here below
And resulting Plot I am getting is this.
I look forward to your answers. Thank you.
If the time values go across midnight, you need to add a date part to the time value, so they can be plotted correctly as before and after midnight. At the very least, the time values for the first day should have a 0 before the decimal, e.g. 0.875 for 9 pm, and the values after midnight should have a 1 before the decimal, e.g. 1.125 for 1 am, so it falls on the next day and not the same day as the 9pm value.
Then plot an XY Scatter chart.
Work out what Excel's internal number (date/time value showing in General format) is for the desired X axis minimum, maximum and major/minor increments and format the x axis accordingly. Set the number format to hh:mm
Edit: For example: you want the minimum X axis value to be 24-Dec-2015 11 pm. Write that into a cell as a date/time. Format the cell to General. Then use the number you see in the format dialog for the X axis minimum.
If you want the major unit to be 1 hour, write the time value 1:00 into a cell and format it with general. Use that number in the dialog for Major.
Format the X axis labels to show time values, not dates.

how to put the different times in y axis in matlab

greeting for every one,
I have data in excel file and i want to draw a plot in Matlab in which the Y axis represent the time with starting time in 10:45 for 24 hours i.e, from 10:00 am to the next day in 10:00 am. The x-axis represents the excel file data( the values of frequencies during 24 hours)
how to put the different times in the y axis showing the values of time in the formula of time(00:00 am/pm) using matlab?
if i use this code: ylim(subplot2,[1 24]) and xlim(subplot2,[170 230]) it will be plotted but the y-axis shows only the hours from 1 to 24 hours and i need the y-axis from 10:45 am(starting time) to(10:45)am in interval 24 hours
You can create custom tick labels by specifying tick strings with the command:
time_cells = {'10:45','11:45',...,'9:45','10:45'};
set(gca, 'YTickLabel', time_cells)
Where gca is the handle of your current plot (axes), and the time_cells is a cell array containing all your required tick labels (without the ellipse). It is probably easiest to generate this using a for-loop to create the numbers you want, and then num2str to convert to the strings you need.

Resources