Several options exist to change the default labels and legends. Recall, this code:
ggplot(
r dataframe_name, aes(x=
r df_char1_name, y=
r df_numeric1_name) +
geom_jitter() +
geom_boxplot(aes(color =
r df_char1_name))
original_plot <- ggplot(df_input, aes(!!sym(df_char1_name), !!sym(df_numeric1_name))) + geom_jitter() + geom_boxplot(aes(color = !!sym(df_char1_name))) original_plot
But it has two problems:
1. The x-axis label is redundant
2. The figure legend is also redundant
labs
ggplot(
r dataframe_name, aes(x=
r df_char1_name, y=
r df_numeric1_name) +
geom_jitter() +
geom_boxplot(aes(color =
r df_char1_name)) +
labs(x ="") #blank quotes removes the label
labs
Gave us this plot:
ggplot(df_input, aes(!!sym(df_char1_name), !!sym(df_numeric1_name))) + geom_jitter() + geom_boxplot(aes(color = !!sym(df_char1_name))) + labs(x = "")
guides
ggplot(
r dataframe_name, aes(x=
r df_char1_name, y=
r df_numeric1_name) +
geom_jitter() +
geom_boxplot(aes(color =
r df_char1_name)) +
labs(x ="") #blank quotes removes the label +
guides(color = "none")
guides
lab_plot <- ggplot(df_input, aes(!!sym(df_char1_name), !!sym(df_numeric1_name))) + geom_jitter() + geom_boxplot(aes(color = !!sym(df_char1_name))) + labs(x = "") + guides(color = "none") original_plot + lab_plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.