Skip to content

Commit

Permalink
updated all plots by adding creature images
Browse files Browse the repository at this point in the history
  • Loading branch information
davdrose committed May 13, 2024
1 parent 623fb32 commit 88b4d10
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 21 deletions.
84 changes: 63 additions & 21 deletions code/R/teleological_properties.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,17 @@ ggplot(data = df.exp2.long,
expand_limits(x = c(-Inf, 5.3)) +
scale_y_continuous(breaks = 1:7,
labels = c(
"1" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleology_generics/master/figures/storyboard.png' width='20' height='20'>",
"1" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleological_properties/master/figures/plot_additions/left_creature.png' width='35' height='30'>",
"2" = "2",
"3" = "3",
"4" = "unsure",
"5" = "5",
"6" = "6",
"7" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleology_generics/master/figures/storyboard.png' width='20' height='20'>"
"7" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleological_properties/master/figures/plot_additions/right_creature.png' width='35' height='30'>"
)) +
theme(axis.text.x = element_markdown())
# ggsave(width = 5, height = 3, "../../figures/experiment2/exp2_property_by_condition_means.pdf")
ggsave(width = 8, height = 5, "../../figures/experiment2/exp2_property_by_condition_means.pdf")
```

Expand Down Expand Up @@ -699,28 +699,49 @@ ggplot(data = df.exp3.long,
color = property,
fill = property,
shape = condition)) +
geom_hline(yintercept = 4, linetype = "dashed") +
geom_point(position = position_jitterdodge(dodge.width = 0.5,
jitter.width = 0.1,
jitter.height = 0.0),
alpha = 0.05) +
jitter.width = 0.15,
jitter.height = 0.1),
alpha = 0.2) +
theme(legend.position = "none") +
stat_summary(fun.data = "mean_cl_boot",
position = position_dodge(width = 0.5),
position = position_dodge(width = 0.55),
color = "black",
size = .5) +
size = .9) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
scale_y_continuous(breaks = 1:7) +
scale_shape_manual(values = c(21, 23)) +
theme(plot.title = element_text(size=16, hjust = .5),
ggtitle("What is this creature?") +
xlab("Property type of creature \n\ that differed") +
theme(plot.title = element_text(size=24, hjust = .5),
legend.title = element_blank(),
legend.position = "bottom",
axis.title.x = element_blank()) +
axis.title.x = element_blank(),
axis.text.x = element_text(size=16),
axis.title.y = element_text(size=18),
axis.text.y = element_text(size=14),
legend.text = element_text(size=16)) +
guides(fill = "none",
color = "none",
shape = guide_legend(override.aes = list(fill = "gray50")))
shape = guide_legend(override.aes = list(fill = "gray50"))) +
coord_flip() +
annotation_custom(raster_midpoint_creature, xmin=4.35, xmax=5.3, ymin=-Inf, ymax=Inf) +
expand_limits(x = c(-Inf, 5.3)) +
scale_y_continuous(breaks = 1:7,
labels = c(
"1" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleological_properties/master/figures/plot_additions/left_creature.png' width='35' height='30'>",
"2" = "2",
"3" = "3",
"4" = "unsure",
"5" = "5",
"6" = "6",
"7" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleological_properties/master/figures/plot_additions/right_creature.png' width='35' height='30'>"
)) +
theme(axis.text.x = element_markdown())
ggsave(width = 5, height = 3, "../../figures/experiment3/exp3_property_by_condition_means.pdf")
ggsave(width = 8, height = 5, "../../figures/experiment3/exp3_property_by_condition_means.pdf")
```

Expand Down Expand Up @@ -877,28 +898,49 @@ ggplot(data = df.exp4.long,
color = property,
fill = property,
shape = condition)) +
geom_hline(yintercept = 4, linetype = "dashed") +
geom_point(position = position_jitterdodge(dodge.width = 0.5,
jitter.width = 0.1,
jitter.height = 0.0),
alpha = 0.05) +
jitter.width = 0.15,
jitter.height = 0.1),
alpha = 0.2) +
theme(legend.position = "none") +
stat_summary(fun.data = "mean_cl_boot",
position = position_dodge(width = 0.5),
position = position_dodge(width = 0.55),
color = "black",
size = .5) +
size = .9) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
scale_y_continuous(breaks = 1:7) +
scale_shape_manual(values = c(21, 23)) +
theme(plot.title = element_text(size=16, hjust = .5),
ggtitle("What is this creature?") +
xlab("Property type of creature \n\ that differed") +
theme(plot.title = element_text(size=24, hjust = .5),
legend.title = element_blank(),
legend.position = "bottom",
axis.title.x = element_blank()) +
axis.title.x = element_blank(),
axis.text.x = element_text(size=16),
axis.title.y = element_text(size=18),
axis.text.y = element_text(size=14),
legend.text = element_text(size=16)) +
guides(fill = "none",
color = "none",
shape = guide_legend(override.aes = list(fill = "gray50")))
shape = guide_legend(override.aes = list(fill = "gray50"))) +
coord_flip() +
annotation_custom(raster_midpoint_creature, xmin=4.35, xmax=5.3, ymin=-Inf, ymax=Inf) +
expand_limits(x = c(-Inf, 5.3)) +
scale_y_continuous(breaks = 1:7,
labels = c(
"1" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleological_properties/master/figures/plot_additions/left_creature.png' width='35' height='30'>",
"2" = "2",
"3" = "3",
"4" = "unsure",
"5" = "5",
"6" = "6",
"7" = "definitely<br><img src='https://raw.githubusercontent.com/cicl-stanford/teleological_properties/master/figures/plot_additions/right_creature.png' width='35' height='30'>"
)) +
theme(axis.text.x = element_markdown())
ggsave(width = 5, height = 3, "../../figures/experiment4/exp4_property_by_condition_means.pdf")
ggsave(width = 8, height = 5, "../../figures/experiment4/exp4_property_by_condition_means.pdf")
```

Expand Down
Binary file modified figures/experiment2/exp2_property_by_condition_means.pdf
Binary file not shown.
Binary file modified figures/experiment3/exp3_property_by_condition_means.pdf
Binary file not shown.
Binary file modified figures/experiment4/exp4_property_by_condition_means.pdf
Binary file not shown.

0 comments on commit 88b4d10

Please sign in to comment.