Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6087.

It does so by preserving the slope and intercept as computed variables and using geom = "abline".

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
#> Warning: package 'testthat' was built under R version 4.4.2

ggplot(mpg, aes(sample = displ)) +
  geom_qq() +
  geom_qq_line() +
  ylim(range(mpg$displ)) +
  coord_cartesian(clip = "off")

Created on 2024-12-06 with reprex v2.1.1

@thomasp85
Copy link
Member

I can't believe you are still using the windows graphics device 😛

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand
Copy link
Collaborator Author

teunbrand commented Jan 27, 2025

I can't believe you are still using the windows graphics device

Look man, it is the default GD when using {reprex}. I've my own session setup with ragg. I make sure to setup a proper GD in the readmes that I write. I have an rstudio shortcut that is called 'raggprex' to the following code:

#+ setup, include=FALSE
knitr::opts_chunk$set(dev = "ragg_png")

#+ main

Which I can then follow up with the actual code to reprex. Sometimes I forget to use the shortcut. If we could just permanently set the GD to ragg in {reprex}, I would be a happy camper, but until such a time, I'll throw around some pixellated lines every now and then :p

@teunbrand teunbrand merged commit 0b67516 into tidyverse:main Jan 27, 2025
13 checks passed
@teunbrand teunbrand deleted the clip_qq_line branch January 27, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Could geom_qq_line always stop at the limits, regardless of other settings?

2 participants