Everything up to this point gets you a basic graph; but what about colors, shapes and overall style?
You can change 5 basic aesthetics
1. Color- changes the outline color of your datapoints
2. Size - choose the size of the datapoint
3. Shape - choose a pre-defined shape
4. Alpha- changes the transparency of each point
5. Fill- changes the fill color of your points
Beyond simply changing the size or color of the variables in your plot, you can encode more information by mapping these values to data in your data set.
In ggplot2, we have the options to set mappings globally or locally. Setting a mapping globally means to set those values in the original ggplot function.
Example:
ggplot(
r dataframe_name) +
geom_jitter(aes(x=
r df_char1_name, y=
r df_numeric1_name))+
geom_boxplot(aes(x=
r df_char1_name, y=
r df_numeric1_name))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.