Skip to content

xaxl/yaxl symbol shortcuts#373

Merged
grantmcdermott merged 3 commits intomainfrom
axl_symbol
Apr 12, 2025
Merged

xaxl/yaxl symbol shortcuts#373
grantmcdermott merged 3 commits intomainfrom
axl_symbol

Conversation

@grantmcdermott
Copy link
Copy Markdown
Owner

This PR would allow users to pass the equivalent symbol as a(n even shorter) shortcut to xaxl/yaxl. For example, "percent" <=> "%", "dollar" <=> "$", etc.

pkgload::load_all("~/Documents/Projects/tinyplot")
#> ℹ Loading tinyplot
tinytheme('ipsum')

dat = data.frame(
  x = rnorm(100, 1e3, 50),
  y = rnorm(100, 1e3, 10)
)
plt(y ~ x, dat, xaxl = "", yaxl = "$")

plt(y ~ I(x/1e4), dat, xaxl = "%", yaxl = ",")

tinytheme()

Created on 2025-04-10 with reprex v2.1.1

Thoughts?

@grantmcdermott grantmcdermott changed the title xaxl/`yaxl symbol shortcuts xaxl/yaxl symbol shortcuts Apr 11, 2025
@vincentarelbundock
Copy link
Copy Markdown
Collaborator

I like this A LOT but think we should remove the long shortcuts to avoid duplication and confusion.

@grantmcdermott
Copy link
Copy Markdown
Owner Author

Ha, the Vincent "anti-aliasing" principle strikes again!

In seriousness, though I wouldn't want to replace the longer strings. Personally, I'm comfortable keeping both options. Let's see what Achim says...

@zeileis
Copy link
Copy Markdown
Collaborator

zeileis commented Apr 11, 2025

I have to confess that I also like the idea with the shortcuts and would keep both versions - the short symbol and the long text version.

If we only keep one of the two, I would keep the long text version (and not the short symbol).

@grantmcdermott
Copy link
Copy Markdown
Owner Author

Majority rules ;-)

@grantmcdermott grantmcdermott merged commit 213c5d9 into main Apr 12, 2025
3 checks passed
@grantmcdermott grantmcdermott deleted the axl_symbol branch April 12, 2025 05: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.

3 participants