Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Proof-of concept support for unit() throughout ggplot2#5610

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mjskay wants to merge16 commits intotidyverse:main
base:main
Choose a base branch
Loading
frommjskay:unit

Conversation

@mjskay
Copy link
Contributor

@mjskaymjskay commentedDec 22, 2023
edited
Loading

This PR is a proof-of-concept for support ofunit() throughout ggplot2. It shows how some of the ideas in#5609 might be implemented.

To tease, it would allow you to do stuff like this:

data.frame(var1=1:5,var2=1:5,name=letters[1:5])|>  ggplot(aes(var1,var2))+   geom_point()+  geom_line()+# labels exactly 10 points right of their points, no matter how the# plot is resized  geom_text(aes(label=name,x=var1+ as_pt(10)))+# an annotation that is always 10 points inset from the lower right  annotate("text",x= as_npc(1)- as_pt(10),y= as_pt(10),label="some label",vjust=0,hjust=1  )+  coord_polar()

image

It is a draft only for several reasons:

  1. Several of the proposed changes probably shouldn't live in ggplot2, but in vctrs, grid, or perhaps scales.
  2. This is just a prototype, not a comprehensive, solid, well-tested solution.
  3. While the solution for positional aesthetics (I think) covers most cases, the solution for non-positional aesthetics is only mocked up forgeom_point().

Would love to hear folks' thoughts, or if I am barking up the wrong tree...

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@mjskay

[8]ページ先頭

©2009-2025 Movatter.jp