Skip to content
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

Extend the plot range of geom_density() nicely #3716

Open
yutannihilation opened this issue Jan 9, 2020 · 0 comments
Open

Extend the plot range of geom_density() nicely #3716

yutannihilation opened this issue Jan 9, 2020 · 0 comments
Labels
visual change 👩‍🎨 Rendering change that will affect look of output

Comments

@yutannihilation
Copy link
Member

(See #3708 (comment))

Compared to the base R's density plot, geom_density() draws in a narrower range. As a result, the line doesn't touch the X-axis. Though it needs a lot of care to extrapolate the data correctly, it's nice if geom_density() can draw the bottom right one below.

plot(density(diamonds$carat, adjust = 5))

p <- ggplot(diamonds, aes(carat)) +
  geom_density(adjust = 5)

patchwork::wrap_plots(
  p + ggtitle("(default)"),
  p + ggtitle("(expanded)") + expand_limits(x = -0.5)
)

@thomasp85 thomasp85 added the visual change 👩‍🎨 Rendering change that will affect look of output label Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
visual change 👩‍🎨 Rendering change that will affect look of output
Projects
None yet
Development

No branches or pull requests

2 participants