Plot blocks #153
DivadNojnarg
started this conversation in
General
Plot blocks
#153
Replies: 1 comment
-
Below is an example of a plot we generate with @karmatarap, which should give use some insight about what core elements to support: p <- ggplot(data) +
geom_point(
mapping = aes(
x = .data[[x_var]],
y = .data[[y_var]],
color = .data[[color]],
shape = .data[[shape]]
),
size = 3
) +
geom_errorbar(
aes(
x = .data[[x_var]],
y = .data[[y_var]],
ymin = MEAN - SE,
ymax = MEAN + SE,
color = ACTARM
),
width = 0.2
) +
geom_line(
aes(
x = .data[[x_var]],
y = .data[[y_var]],
group = .data[[color]],
color = .data[[color]]
)
) +
labs(
title = .(title),
x = .(x_lab),
y = .(y_lab)
) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
legend.title = element_text(face = "bold"),
legend.position = "bottom"
) +
scale_color_brewer(name = "Treatment Group", palette = "Set1") +
scale_shape_manual(
name = "Treatment Group",
values = c(16, 17, 18, 19, 20)
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation: We currently build plots as a single big block. This is not sustainable and hard to customise for the end user.
Proposition:
aes
for mappings should be a composite field by leveragingnew_list_field
.Questions:
geom_points
understandsx
,y
,alpha
, ... whilegeom_line
also supportslinetype
.cc @christophsax, @JohnCoene and @nbenn.
Beta Was this translation helpful? Give feedback.
All reactions