Skip to content

xaxl / yaxl args for formatting axis tick labels#363

Merged
grantmcdermott merged 6 commits intomainfrom
xaxl
Apr 6, 2025
Merged

xaxl / yaxl args for formatting axis tick labels#363
grantmcdermott merged 6 commits intomainfrom
xaxl

Conversation

@grantmcdermott
Copy link
Copy Markdown
Owner

Closes #362.

Examples:

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

plt(I(decrease/100) ~ treatment, OrchardSprays, main = "No label formatting")

plt(I(decrease/100) ~ treatment, OrchardSprays, main = "With label formatting",
    xaxl = tolower, yaxl = "percent")

#works well with themes
tinytheme('clean')
plt(I(decrease/100) ~ treatment, OrchardSprays, main = "With label formatting",
    xaxl = tolower, yaxl = "percent")

plt(GNP ~ Year, longley, type = "area", yaxl = "dollar")

# also works with functions from the scales package
plt(
  I(Sepal.Length*1e4) ~ Petal.Length | Species, facet = "by", data = iris,
  yaxl = scales::label_log(), log = "y"
)

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

@grantmcdermott grantmcdermott merged commit 1b99657 into main Apr 6, 2025
3 checks passed
@grantmcdermott grantmcdermott deleted the xaxl branch April 6, 2025 21:32
@grantmcdermott grantmcdermott mentioned this pull request Apr 6, 2025
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.

Axis labeller function (xaxl / yaxl?)

1 participant