Could ggplot support positioning the axis within the panel (e.g. in guide_axis)?
Open
Nobody has claimed this yet.
feature
guides :straight_ruler:
- Dominant language
- R
- Stars
- 7k
- Forks
- 2.1k
- Avg merge
- 59m
- Merged PRs (30d)
- 2
Description
Apologies if this has already been asked.
Sometimes it might be wanted to place an axis within a panel (e.g. at zero).
I was wondering if it was possible for dup_axis to provide this functionality?
So something like this for a y axis intercepting the x at 0..
p +
scale_y_continuous(
sec.axis = dup_axis(
xintercept = 0,
)
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown scale_y_continuous() and dup_axis() example and inspect ggplot2's axis and guide behavior. Determine how an axis could be positioned at x = 0 within the panel, whether dup_axis() or guide_axis() is the appropriate entry point, and define tests that verify the requested placement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100