![]() The chart is well-labeled and the color-coding makes it easy to identify which data go with each axis.įinally, we can quickly add data to a chart using VBA. These modifications give us the chart below. Click the green plus sign, then the arrow next to Legend, and select Bottom: You can change the axis title in the same way.Īs another way of identifying which data goes with which axis, we can add a legend to the bottom of the chart. Select the axis and change the color to match the data with the Font Color tool: ![]() We can also change the color scheme of our graph to make it clear which dataset belongs to each axis. Select the arrow next to Axis Titles (visible when you hover over it), and click the checkbox next to Secondary Vertical:ĭouble-click the new axis title to rename it. To add a title to the new axis, click in the chart area and select the green plus sign. ![]() To finish formatting this chart, we’ll add appropriate labels. Scroll down in the task pane to Number and reduces the decimal places to 2. Set the minimum bound to -0.2 and the maximum to 0.2. Switch to Axis Options with the bar chart icon:įor these data, a range of ☐.2 works well. With the task pane still open, click on the new axis. However, Excel always leaves extra empty space on both sides of an axis by default, so you can modify the axis as we did in Section 1 of this chapter. It also scales the sine wave to cover most of the chart area. This will add an additional axis on the right side of the chart. You can add a secondary axis so that the sine wave covers more of the chart by right-clicking on it, selecting Format Data Series, and choosing Secondary Axis from the task pane. To change the colors of the series so that each one has its own unique color, click the paintbrush next to the upper right of the chart, then Color, and choose a different palette.Ĭurrently, both data series are sharing a common y-axis, and the amplitude of the sine wave is small relative to the range of the first curve. Do the same for the title’s red box so the new series is titled correctly: Click on the curve, then click and drag the selected Y data (remember to hover over the blue border to get the pointer with four arrows). We’re now able to edit the data for one of the data series, similar to in the previous section. There are now two data series currently on the chart (you can verify this by checking the Select Data Source window). If you press the Down Arrow key, that argument changes to a 1 – this is the original curve. We have the same formula as before, where cells B3-B43 are the X data, and C3-C43 are the Y data. To see what’s happening, we can click on the data series and look at the formula bar: This will paste a second series that has the same input data (so it lies directly on top of the first one). Type Ctrl-C to copy it, and Ctrl-V to paste it. Click on the data that’s plotted on the chart. There’s another method to add series that may be easier when you’re dealing with large amounts of data. Click OK and both data series will be shown on the chart. Select it, choose Edit, then choose the header for column C. In the Select Data Source window, we can also give a name to the first series. Click inside the box below Series X values, then select the X data (either click and drag or click the first cell and press Ctrl-Shift-Down). This time, Excel won’t know the X values automatically. In the Edit Series window, click in the first box, then click the header for column D. Click Add above the bottom-left window to add a new series. Right-click the chart and choose Select Data. The first method is via the Select Data Source window, similar to the last section. In this section, we’ll add a second plot to the chart in Worksheet 02b. Often, engineers need to display two or more series of data on the same chart.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |