feature request: allow changing the labels of the legends
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 442
- Forks
- 93
- Avg merge
- 3h 11m
- Merged PRs (30d)
- 1
Description
This is an idea that came up in the discussion of #73
The point is to let users change the labels of the legend in bayesplot objects easily, possibly by setting them as arguments in the plot creation. This could for instance be helpful to plot the pp_check for two models and then label y_rep as model Aor model B, respectively.
I mainly used pp_check() until now but I guess this might be usable for other plotting possibilites as well.
@jgabry wrote in #73:
But another option would be to add additional arguments to all of the bayesplot plotting functions so that user's can specify the names to be used in the legend at the same time they create the plot. For example, it could look something like this maybe:
my_legend <- list(y = "emp. data", yrep = "model predict.") ppc_bars(y, yrep, ..., legend_labels = my_legend)That way the legends could be created with those labels instead of having to change them after the fact. I'd need to figure out the best way to implement that (it would vary depending on the plotting function) but that should be much easier to do.
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 reviewing the discussion in #73 and the quoted ppc_bars() example. Compare how legend labels are produced in pp_check() and the other bayesplot plotting functions, then define a consistent legend_labels interface. Done means users can set labels such as “emp. data” and “model predict.” when creating plots.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100