官术网_书友最值得收藏!

Adding a secondary axis to a time series plot

Time series plots and scatterplots can be used with a secondary axis. Here, we will use the Oxford weather station's data to plot the temperature and hours of sunlight on the same chart. Temperature will be displayed on the left y axis; Sun(Hours) will be displayed on the right axis.

Getting ready

As done in the previous recipe, we will use the Oxford weather station's data. See the details in the Creating a time series plot recipe. Most of the steps in this example will be similar to the time series plot instructions, except the use of the multiple time series plots instead of a single one.

How to do it…

Let's get started with the steps that would help us add a secondary axis to a time series plot:

  1. Go to the Graph menu and select Time Series Plot….
  2. Select the Multiple chart.
  3. Enter the column for mean maximum temperature and the column for hours of sunlight into the section labeled Series:.
  4. Follow the steps in the previous example to add the year and month on the x axis, and for the condition to display only the results from 2000 onwards, that is, from step 4 to step 9.
  5. The graph should appear as shown in the following screenshot:
    How to do it…
  6. Double-click on the y axis to edit the scale as indicated on the screenshot.
  7. From the Edit y axis options, choose the Secondary tab and use the dropdown to put the hours of sunlight column on the Secondary axis, as shown in the following screenshot:
    How to do it…

How it works…

Multiple charts that are overlaid are displayed on the same graph. When the scales are very different, as in this case where temperatures are in degree Celcius and sunlight hours in hours of sunlight in a month, then one response can appear disproportionate to the other. The secondary axis allows independent scaling of both axes while using the same x axis.

This can be a useful tool to display correlations in the data.

主站蜘蛛池模板: 门源| 灌阳县| 孟村| 克东县| 安福县| 大足县| 旬阳县| 延庆县| 房产| 白山市| 南汇区| 连云港市| 宁国市| 万荣县| 沧州市| 南开区| 大方县| 洪江市| 济宁市| 武宁县| 锡林郭勒盟| 交城县| 红河县| 平山县| 溆浦县| 威宁| 武冈市| 东城区| 泗水县| 镇原县| 东乌珠穆沁旗| 中卫市| 万安县| 麻栗坡县| 兴安县| 高台县| 吉林省| 鹤壁市| 迭部县| 北宁市| 铁岭市|