I love Scatter Plots. They give a lot of information and are just plan fun. I wanted to show how you can use images on a scatter plot graph to create an awesome Viz.
Salt Lake City is known for it's winter inversions (when smog gets trapped in the valley during the winter months.) The city has put forth some regulations to decrease pollution from vehicles, power plants and wood burning fireplaces. I wanted to create a viz to show how this has affected the number of bad inversion days. (Spoiler Alert... is hasn't helped.)
Here's how I created this Viz.
The first thing I did was collect my data (via the Utah Division of Air Quality.) I entered that into columns A, B and C. The next thing I needed to do was figure out How I wanted to show the data and Where to plot the levels. (Note the sorting... Measure Desc and then Levels... this is important.)
The first thing I did was collect my data (via the Utah Division of Air Quality.) I entered that into columns A, B and C. The next thing I needed to do was figure out How I wanted to show the data and Where to plot the levels. (Note the sorting... Measure Desc and then Levels... this is important.)
I selected the following background image and pasted it into an Excel worksheet. This allowed me to figure out the Size of my graph and my X and Y Axis's. Now I needed to figure out the X and Y Coordinates for each of the Levels. Since I wanted them to appear in a certain order, I sorted my Excel data by Measure Desc and then Levels. The Lowest Levels should always start at the car exhaust, power plant stack and house chimney... so using my Excel worksheet I was able to identify the starting X and Y coordinates, then the next coordinates and so forth. I then added an Image column and numbers 1 thru 10. This was used to keep the order of appearance straight (I also us it for my Shapes.)
Now that the prep work was all done, I opened Tableau and did the following:
1. Connected to my data source (Excel spreadsheet)
2. Dragged over my Column and Row fields (I like to give fields easy names...)
3. Made Image a shape (I then assigned all 10 of the #'s to an image of smoke... I could have used a different image for each number but decided just to use a single one.)
4. Made Levels the colors (used the gray color palette... this made the smoke darker when the levels were higher.)
5. Made Measure Desc my Label (tho I ended up not showing it.)
6. Made Levels the Size (This made the smoke larger when the levels were higher.)
7. Made a Year parameter w/ Values that were 1-10 (made to match Excel spreadsheet)
8. Filtered on Image... By Formula [Image] <= [Parameters].[Year]
After that I decided that I wanted the Background image to change according to the # of Inversion Days. So I created 10 images that had varying shades of Gray for the sky. I added them all to my Mapped Background Images and under Options made them Only Show When a certain Year/Value was selected.
I hope this was helpful... feel free to email me with any questions.
1. Connected to my data source (Excel spreadsheet)
2. Dragged over my Column and Row fields (I like to give fields easy names...)
3. Made Image a shape (I then assigned all 10 of the #'s to an image of smoke... I could have used a different image for each number but decided just to use a single one.)
4. Made Levels the colors (used the gray color palette... this made the smoke darker when the levels were higher.)
5. Made Measure Desc my Label (tho I ended up not showing it.)
6. Made Levels the Size (This made the smoke larger when the levels were higher.)
7. Made a Year parameter w/ Values that were 1-10 (made to match Excel spreadsheet)
8. Filtered on Image... By Formula [Image] <= [Parameters].[Year]
After that I decided that I wanted the Background image to change according to the # of Inversion Days. So I created 10 images that had varying shades of Gray for the sky. I added them all to my Mapped Background Images and under Options made them Only Show When a certain Year/Value was selected.
I hope this was helpful... feel free to email me with any questions.