Sometimes the datapoints are just randomly scattered around and we have no correlation. The larger one value is, the smaller the other value is. On the other hand, if they move left and down, it is a negative correlation. If the datapoints move left and upward, we can assume larger values of Variable X usually indicate larger values of Variable Y. Scatter plots are great for comparing how two variables relate to each other, since we can quickly see whether correlation exists between them or not. Scatter plots have a numerical (or date) value for both axes, whereas most other charts have a numerical axis and a categorical axis (like a country or department name). In our automating Excel charts with VBA tutorial, we talked about switching the axes between horizontal and vertical, and we mentioned scatter plot axes don’t behave the same.
xlsm format, if you want to keep your work. Once your file’s open, you can save it in an Excel.
Just download the file and open it in Excel, so it looks like this: Nevertheless, it is sufficient for illustration purposes and it’ll be a fun example.įor convenience, we’ve extracted all our sample data and placed it in a CSV file for you. The data is somewhat asynchronous, especially as the mobile phone data was gathered in the 2010s - a decade of rapid growth in mobile. To demonstrate VBA scatter plot control in this tutorial, we’re going to use nominal GDP, national population, and mobile phone ownership data. More importantly, we’ll demonstrate why controlling a scatter plot with VBA can be so powerful. In this tutorial, we will take an in-depth look at how scatter plots are different and how you can control them using VBA in Excel. If you recall, we said scatter plots are a bit different from most other chart types.
A couple weeks ago we described how to create Excel charts with VBA.