8000 Updates to ggplot2 docs by danton267 · Pull Request #95 · plotly/plotly.r-docs · GitHub
[go: up one dir, main page]

Skip to content

Updates to ggplot2 docs #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into new-ggplot2-docs
  • Loading branch information
HammadTheOne authored Sep 28, 2021
commit 3e9a886115d5cb29def4223cdcd3eed93dbde95a
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ Imports:
ggQC,
fmsb,
plotROC,
tidyquant
tidyquant,
ggplot2movies
3 changes: 1 addition & 2 deletions ggplot2/2021-08-04-violin.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ library(ggplot2)
district_density <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/district_density.csv", stringsAsFactors = FALSE)
district_density$cluster <- factor(district_density$cluster, levels=c("Pure urban", "Urban-suburban mix", "Dense suburban", "Sparse suburban", "Rural-suburban mix", "Pure rural"))
district_density$region <- factor(district_density$region, levels=c("West", "South", "Midwest", "Northeast"))
3

p <- ggplot(district_density,aes(x=cluster, y=dem_margin, fill=cluster)) +
geom_violin(colour=NA) +
geom_hline(yintercept=0, alpha=0.5) +
Expand Down Expand Up @@ -205,7 +205,6 @@ Including facetting by region.

Add colour to the facet titles, centre-align the title, rotate the y-axis title, change the font, and get rid of the unnecessary legend. Note that `coord_flip()` flips the axes for the variables and the titles, but does not flip `theme()` elements.


Rotated the x-axis text 45 degrees, and used `facet_grid` to create a 4x1 facet (compared to `facet_wrap`, which defaults to 2x2).

```{r}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0