Data Vis 101 - Simple Scatter Plot

The data type we will be working with today is the Scatter Plot.

For Scatter Plot data, lets start with pulling in 2 of our spreadsheets like always, one data and one name and make a large rectangle to hold our data, set trim paths if you want. Create a Text Layer for our Days Axis data, center align it, and format it however you like, but keep it small. Connect in our Days sheet into the String attribute. Add it to a Duplicator set to linear horizontal distribution, Connect the Row Count attribute from our Scatter Amount sheet into this duplicators Count Attribute, position it as needed.

For the Amount axis, Duplicate the Days text layer and rename it to whatever you need it to be. Create a Line and format it to be a thin dotted line, and connect the Width attribute of the rectangle we created into the Lines Length. Group the Amount Text and the line together and position the Text Layer to the left of the line. With this group selected, Alt click on the duplicator icon, set that to Linear Vertical distribution and make sure to keep the Size Mode to FIT, and for the count, add as many segments as you want. I'm going to do 4. increase the Size attribute until it fits the height of the graph.

For the Amount Text input, disconnect our Days sheet because we want to use the MAX number of our sets. We can figure this out in our Google Sheet by using the function =MAX(range). Duplicate our Scatter Amount Spreadsheet Utility and rename it to Y Axis MAX. Set the Column Title to Set 1 MAX and make sure to check Fixed Row.

Next Click on the little plus next to the String Attribute in our Amount Text and add a string generator. Set the padding and precision to whatever you need (you may need to adjust the positioning of your text layer). Right click on the Number attribute and add a Number Range.

Set the source min to 0 and connecting our Y Axis Duplicator Count attribute into the source max with an expression of -1 (This is because the count is 4, but indexes in Cavalry start with 0, not one. So 4 indices is 0-3), our output minimum being 0 and connecting our Y Axis MAX sheet into the output Max. Last thing to do is to connect the Index Context from our Y Axis Duplicator into the Value attribute of our Number Range.

With this setup you can adjust the Y Axis Duplicator Count to add more or less horizontal 'information' bars as needed.

This is actually the easy part. Create an ellipse or polygon and format it however you like. Name it Point. With that layer selected, ALT click on the duplicator icon and name that duplicator Data Points. Set Distribution to Linear Horizontal and connect the Size and count attribute from our X axis duplicator into this duplicators size and count attributes.

In our Scatter Amount sheet, make sure that the Column Title attribute is set to Set 1. We need to remap this data to fit the height of our graph, so lets set the Remapping attribute to Number Range, with the source min being 0, and connecting our Y Axis Max sheet output into the source max attribute. The output min can be 0, and connect the Size attribute of our Y Axis Duplicator into the output max. Finally, plug the Scatter Amount output into our Data Points duplicator's Shape Position Y attribute. This should position the points vertically where they should be relative to the Data Points duplicator position. You will most likely need to adjust the Data Points Y Position to get things to be visually correct in the graph. Since we know the Maximum Value of this set is 95, we can just align the highest dot to our top 'information' line on the graph.

Now you've got your scatter plot, but sometimes just showing the dots makes it harder to immediately see what's going on. We can add a quick line based on the points to visualize better. In our quick add menu, or hit ctrl/command period if you are a cool kid, and search for the Points to Path layer, and name it Visualine. You can style this Visualine however you want. In the Visualine's Shape tab, change the Point Source attribute to Submesh and drag in our Data Points duplicator. And boom, our data is easier to understand.

For animating, it's the same process as the Bar Charts and Pie Charts. You can check out those videos for more details. And for the Visualine, once you've got the other animation set up, you can just animate the trimpaths like this.

Support me - If you want to support the content Iā€™m making, the easiest way to support is to subscribe and share my Youtube channel. If you are learning Cavalry you can buy some of my tutorial Cavalry files here, and I am also making my own plugins for Cavalry here.

Next
Next

Data Vis 101 - Animate Over Time