Polar coordinates

1. Polar coordinates

Every plot we've made so far has used a Cartesian coordinate space.

2. Projections control perception

For two dimensions, this just means two orthogonal axes composed of straight lines. We can control how our data is perceived, by changing the limits of each axis and the aspect ratio, which we've covered already.

3. Projections control perception

However, another aspect that controls how we perceive data is the plotting projection. An example of this is with maps. We'll cover this in detail in the next course, but it's worth mentioning here in the context of projections.

4. A preview of map projections

There are many projections that we can use to present a 3D object, such as the Earth, on a 2D space, like a map. Some projections are better than others. For example the Mercator projection, on the left, is known to engross regions at the poles and diminish regions around the equator. The Conic projection is an alternative, but still suffers from the problem of projecting a 3D object in 2D.

5. Polar coordinates

The same applies to the Cartesian coordinate system. One of the most common projections is a polar transformation.

6. coord_polar()

Which can be seen here. In this case, theta, the axis which will be presented around the circumference, defaults to the x axis. Imagine that we just take the x axis on the left and bend it until it loops back on itself, while expanding the top side as we go along. We'd end up with the plot on the right.

7. coord_polar(theta = "y")

a more common transformation is to place the y-axis on the circumference by setting theta to y. Actually, this is exactly what we'd do with a bar chart to convert it to a pie chart. As we'll see in the exercises, a pie chart is simply a bar chart transformed onto a polar coordinate system. In the first course I mentioned how good data Visualization uses encoding elements for the data that allows the more efficient and accurate decoding by the viewer. According to that definition, polar coordinates should be used with extreme caution since they considerably distort that data. However, there are some specific use cases of polar coordinates, and we'll explore these in the exercises.

8. Let's practice!

Alright, let's head over to the exercise and take a look at polar coordinates!