6.2.3 Plot and Customize Date Time Data on Graph

Summary

This tutorial will show you how to manipulate the date and time data, and customize the date and time data on the graph.

Plot and Customize Date Time Data on Graph.png

Minimum Origin Version Required: Origin 2015 SR0

What you will learn

  • How to plot the date and time data on the graph.
  • How to customize the date and time tick labels.

Steps

  1. Start with a new project and import the data file Sample\Import and Export\Custom Date and Time.dat under Origin's program folder.
  2. Double-click on A(X) to open the Column Properties dialog; set Format as Date, Display as Custom Display, and input dd'.'MM'.'yyyy hh':'mm':'ss'.'## in the Custom Display box as shown below.
    Plot and Customize Date Time Data on Graph 01.png
  3. Click OK button to go back to the worksheet. Highlight col(B) and select Plot > Basic 2D: Line from the main menu to plot it as a line graph. You will see that the tick labels of X axis are all the same. This is because the tick labels are showing the date information only, but the X data are all in the same day. So we need to change the tick label format to display time.
    Plot and Customize Date Time Data on Graph 02.png
  4. Double-click on the X axis (or select Format : Axes : X Axis from the main menu) to open the Axis dialog. Select Horizonal icon in the Scale tab, set the following first:
    Plot and Customize Date Time Data on Graph 03.png
  5. Go to the Bottom icon in Tick Labels tab, change Type to Time and select Display to HH:mm as shown below.
    Plot and Customize Date Time Data on Graph 04.png
  6. Click the OK button. The tick labels will now show as the corresponding time as in the graph below:
    Plot and Customize Date Time Data on Graph.png