R Data Visualization Recipes
上QQ阅读APP看书,第一时间看更新

How it works...

Step 1 demonstrates that by simple setting the alpha parameter to 0.5, the blending is implemented using ggplot2. Values under one and greater than zero make sense. Smaller values stand for more transparency. Try quite a few values and check how illustration responds to them. Lower values may be more suitable if there are too many points stacked.

Step 2 is doing about the same but using plotly package instead. Here we hold no novelties, the exactly same argument used to apply alpha blending using ggplot2, alpha, is now used to apply alpha blending to a plotly figure. Both works the same way, try values between zero and one.

Next step teaches the ways of accessing alpha blending through ggvis. Now the argument receives another name, opacity, and shall be declared using the := operator instead of the simple =. Values accept here also range from zero to one.