How to Customize Axis Labels to Show Logical Date Intervals
Visualizing data by date is a great way to explore trend. However, because time intervals are not fixed (e.g., a month can be from 28 to 31 days), a fixed axis scaling may not give the most logical axis representation of dates.
Suppose you have data that is collected daily but you want to label the axis in weekly, monthly, quarterly, or yearly intervals. With a new feature in STATISTICA 12, you can easily control the label of the axes in a way that is relevant and makes sense for time.
The data set, Retail.sta, is one of the example data sets included with STATISTICA. To open the data set, select the File tab. In the left pane, select Open Examples. In the Open a STATISTICA Data File dialog box, double-click on the Datasets folder, select the Retail.sta file, and click the Open button.
Select the Graphs tab. In the Common group, click Scatterplot to display the 2D Scatterplots Startup Panel. Click the Variables button to display the Select Variables for Scatterplot dialog box, and select Date as X and Sales as Y.
Click the OK button.
In the 2D Scatterplots Startup Panel, click OK. The resulting graph will be a scatterplot with default date intervals on the x-axis.
The x-axis labels are every 500 units (days in this example) by default. The default units would be appropriate in many situations, but with respect to time, months or years would be more logical.
Now, to customize the date interval on the x-axis, double-click in the graph background to display the Graph Options dialog box.
Under the Axis heading, select Major Units. On the Mode drop-down list, select Manual. Then, select the Date/time step check box to generate a date/time step in the plot. Finally, on the Unit drop-down list, select Year. Note that the Date/time step option is available only when the Mode is set to Manual. Also, note that the step Size is 1 by default and can be adjusted as desired, and Unit can be set to Year, Month, Week, Day, Hour, or Second.
Click OK to apply the changes to the graph that show the x-axis in yearly intervals as shown below.
While this graph shows the same information, the x-axis labeling is clearly better for showing yearly trend.
You can also change the labeling on the x-axis, that is, you can start labeling from January (or any other month) instead of December. To change the labeling on the x-axis, double-click in the graph background to display the Graph Options dialog box.
Under the Axis heading, select Scaling. Change the Mode to Manual, and select January-1952 for the Minimum and January-1966 for the Maximum.
Now, select the Major Units tab, and on the Step Count drop-down list select From Minimum.
Click OK to assign these changes to the graph. The x-axis is labeled from January as shown below.
This graph shows the same information, but the x-axis has been modified to adjust for the first month of the year.
Thus, with the Date/Time step option, you can easily customize the axis labels to show appropriate dates.