Plotting time on X axis in excel

左心房为你撑大大i 提交于 2021-01-27 12:23:16

问题


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 Data table

And resulting Plot I am getting is this.Plot

I look forward to your answers. Thank you.


回答1:


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.



来源:https://stackoverflow.com/questions/34832999/plotting-time-on-x-axis-in-excel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!