Quick Tip - Forcing Viz Aspect Ratios
Disregarding the difficulty in visualizing a spherical representation or Earth on a flat screen, when we look at a map of the United States (or any map), the projection looks 'correct' to us because of the aspect ratio. The same goes for some types of data visualizations. If you struggle with manipulating axes and worksheet sizes when creating a dashboard, I've got a quick tip for you.
Tableau automatically knows to force the correct aspect ratio when you create a viz that uses a map as the base. We can leverage this same technique to force our vizzes to fit the desired aspect ratio by adding a backround image to our viz. By using a simple 1px x 1px transparent image, and defining the X and Y bounds for the image, we can force the correct presentation. The video below illustrates the concept, but let's step through it.
- First, either create an image, or download from here. Note that if you create your image, it doesn't necessarily have to be transparent (you can adjust the washout, but might as well be transparent).
- Go to the Map menu in Tableau Desktop (or Public), select 'Background Images' and then your datasource.
- A listing of any background images tied to your datasource will show up, and will be empty if you've not already added an image. Click 'Add Image'
- Browse for your image
- If necessary, select the appropriate X Field/Y Field. Then set the bounds for your image to fix your aspect ratio - for a 1:1 ratio, set as follows:
- Left: 0
- Right: 1
- Bottom: 0
- Top: 1