在Excel中在X轴上绘制时间 [英] Plotting time on X axis in excel

查看:72
本文介绍了在Excel中在X轴上绘制时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已完成 24小时测量,获得的结果包含大约1400个条目.现在,我要以这种方式绘制这些结果

I have done 24 hour measurement and results obtain contains around 1400 entries. Now I want to plot those results in such a way

  • x轴代表我的时间,y轴代表相应的值.
  • 我的x轴应分为24个部分,每个部分代表1小时.
  • 我的确切开始时间是 14:00 ,结束时间是第二天14:00 .
  • 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.

期待您的答复.谢谢.

推荐答案

如果时间值跨过午夜,则需要在时间值上添加日期部分,以便可以在午夜前后正确绘制它们.至少第一天的时间值在小数点前应为0,例如晚上9点为0.875,午夜后的值应在小数点前加1,例如1.125,代表上午1点,因此它在第二天(而不是当天晚上9点)的值下降.

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.

然后绘制XY散点图.

计算出所需的X轴最小值,最大值和主要/次要增量的Excel内部编号(日期/时间值以常规"格式显示),并相应地格式化x轴.将数字格式设置为hh:mm

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

例如:您希望最小X轴值为2015年12月24日晚上11点.将其作为日期/时间写入单元格中.将单元格格式设置为常规".然后使用您在格式对话框中看到的数字作为X轴最小值.

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.

如果您希望主单位为1小时,则将时间值1:00写入单元格中,并使用常规格式设置其格式.在对话框的专业"中使用该数字.

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.

格式化X轴标签以显示时间值,而不是日期.

Format the X axis labels to show time values, not dates.

这篇关于在Excel中在X轴上绘制时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆