Skip to content

Labeller for legend #447

@grantmcdermott

Description

@grantmcdermott

It would good if we could support the equivalent tinylabel functionality/passing that we do for axes (via x/yaxl)...

library(tinyplot)

dat = transform(data.frame(state.x77), Illiteracy = Illiteracy/100)

plt(
  Life.Exp ~ Illiteracy,
  data = dat,
  xaxl = "%"
)

... for legend labels too:

plt(
  Life.Exp ~ Income | Illiteracy,
  data = dat
)

This should be pretty simple to operationalise via an additional draw_legend(..., labeller/format = ...) argument. Users could then pass down from the top level function as plt(..., legend = list(..., labeller/format = ...)).

P.S. You could say the same thing about breaks (c.f. x/yaxb), at least for continuous/gradient legends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions