Skip to content

Support direct labels for type_barplot & co.? #471

Description

@grantmcdermott

Follow up from #469:

I wonder if we shouldn't support a type_barplot(label = TRUE) argument that would add these labels directly?

Apart from requiring less typing than the current, manual plt_add(type = "text", ...) approach, this would also be easier to integrate with dodged barplots where beside = TRUE. At least, in principle.

But also see @zeileis's reply:

Yes, maybe. Although one argument wouldn't be enough, would it? We would need to decide whether we want to display

  • absolute and/or (conditional) relative frequencies
  • ...or use some other formatter, e.g., for adding custom prefixes, suffixes, rounding, etc. (especially for other aggregation FUNctions)
  • at the top or bottom or center of the box
  • whether to adjust or modify the position
  • what cex or col to use for the text (or possibly other font properties)
  • ...

In short, this is not so trivial, unfortunately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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