December 29, 2017

Explanation

Using the airquality dataset, I will show the relationship between:

  1. Ozone
  2. Solar Radiation
  3. Temperature
  4. Wind Speed

Here I let Ozone be the outcome (y variable) and Solar.R the predictor (x variable). I color the points with a gradient indicating temperature, and let the size of the point indicate wind speed.

I plot (roughly) the same scatterplot twice. First I use ggplotly to convert a more familiar ggplot object into a plotly object. Second I use straight plotly syntax.

ggplot object via ggplotly

plotly

Pros and Cons

GGplotly
Pros:
-I already know ggplot syntax, so feeding it to plotly is easy.
-All the interactive functionality of a plotly graph

Cons:
-Still has ggplot default themes, which aren't great.
-I'm not really learning plotly syntax.

Plotly
Pros:
-All the functionality of a plotly graph
-Better default themes than ggplot

Cons:
-I don't know the syntax, so it takes longer and is more frustrating.