Skip to content

Commit

Permalink
fix chart
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephBARBIERDARNAL committed Jun 14, 2024
1 parent 14a2d90 commit 918939f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 25 deletions.
22 changes: 13 additions & 9 deletions story/OneCatSevOrderedNum.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,19 @@ Line charts tend to be too cluttered as soon as more than a few groups are displ

```{r, fig.align="center", fig.width=10, message=FALSE, warning=FALSE}
data %>%
mutate( highlight=ifelse(name=="Amanda", "Amanda", "Other")) %>%
ggplot( aes(x=year, y=n, group=name, color=highlight, linewidth=highlight)) +
geom_line(linewidth=1) +
scale_color_manual(values = c("#264653", "lightgrey")) +
scale_size_manual(values=c(1.5,0.2)) +
theme(legend.position="none") +
ggtitle("Popularity of American names in the previous 30 years") +
theme_ipsum() +
geom_label(x = 1990, y = 55000, label = "Amanda reached 3550\nbabies in 1970", size = 4, color = "#69b3a2")
mutate(highlight = ifelse(name == "Amanda", "Amanda", "Other")) %>%
ggplot(aes(x = year, y = n, group = name, color = highlight, size = highlight)) +
geom_line() +
scale_color_manual(values = c("#69b3a2", "lightgrey")) +
scale_size_manual(values = c(1.5, 0.2)) +
theme(legend.position = "none") +
ggtitle("Popularity of American names in the previous 30 years") +
theme_ipsum() +
geom_label(x = 1990, y = 55000, label = "Amanda reached 3550\nbabies in 1970", size = 4, color = "#69b3a2") +
theme(
legend.position = "none",
plot.title = element_text(size = 14)
)
```

This is a good way to describe the behavior of a specific group in the dataset.
Expand Down
36 changes: 20 additions & 16 deletions story/OneCatSevOrderedNum.html

Large diffs are not rendered by default.

Binary file added story/OneCatSevOrderedNum_files/.DS_Store
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 918939f

Please sign in to comment.