add_sum_bar | R Documentation |
Add sum
add_sum_bar(
plot,
dodge_width = NULL,
width = 0.6,
saturation = 1,
preserve = "total",
...
)
add_sum_dash(
plot,
dodge_width = NULL,
width = 0.6,
linewidth = 0.25,
preserve = "total",
...
)
add_sum_dot(plot, dodge_width = NULL, size = 2, preserve = "total", ...)
add_sum_value(
plot,
dodge_width = NULL,
accuracy = 0.1,
scale_cut = NULL,
fontsize = 7,
extra_padding = 0.15,
vjust = NULL,
hjust = NULL,
preserve = "total",
...
)
add_sum_line(
plot,
group,
dodge_width = NULL,
linewidth = 0.25,
preserve = "total",
...
)
add_sum_area(
plot,
group,
dodge_width = NULL,
linewidth = 0.25,
preserve = "total",
...
)
plot |
A |
dodge_width |
For adjusting the distance between grouped objects. Defaults
to |
width |
Width of the plot area. Defaults to |
saturation |
A |
preserve |
Should dodging preserve the |
... |
Arguments passed on to the |
linewidth |
Thickness of the line in points (pt). Typical values range between |
size |
A |
accuracy |
A number to round to. Use (e.g.) Applied to rescaled data. |
scale_cut |
Scale cut function to be applied. See |
fontsize |
Font size in points. Defaults to |
extra_padding |
Extra padding to create space for the value label. |
vjust |
Vertical position adjustment of the value label. |
hjust |
Horizontal position adjustment of the value label. |
group |
Variable in the dataset to be used for grouping. |
A tidyplot
object.
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_bar()
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_dash()
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_dot()
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_value()
spendings |>
tidyplot(x = category, y = amount) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_line()
spendings |>
tidyplot(x = category, y = amount) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_area()
# Combination
spendings |>
tidyplot(x = category, y = amount) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_median_bar(alpha = 0.4) |>
add_median_dash() |>
add_median_dot() |>
add_median_value() |>
add_median_line()
# Changing arguments: alpha
# Makes objects transparent
spendings |>
tidyplot(x = category, y = amount, color = category) |>
theme_minimal_y() |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_bar(alpha = 0.4)
# Changing arguments: saturation
# Reduces fill color saturation without making the object transparent
spendings |>
tidyplot(x = category, y = amount, color = category) |>
theme_minimal_y() |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_bar(saturation = 0.3)
# Changing arguments: accuracy
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_value(accuracy = 1)
# Changing arguments: fontsize
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_value(fontsize = 10)
# Changing arguments: color
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_value(color = "black")
# Changing arguments: extra_padding
spendings |>
tidyplot(x = category, y = amount, color = category) |>
adjust_x_axis(rotate_labels = TRUE) |>
add_sum_value(extra_padding = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.