Skip to content

Improve scales documentation #3291

Closed
Closed
@paleolimbot

Description

@paleolimbot

There are several opportunities to improve the documentation for scale-related functions, including scale_(x|y)_continuous(), scale_(x|y)_discrete(), scale_*_gradient(), and scale_*_brewer(). This is a documentation issue intended for the tidyverse dev day (#3267).

  • In scale_*_gradient(), it may be worth mentioning that passing na.value = NA is useful when used with the fill aesthetic (fill = NA results in no fill), but will not work for the colour aesthetic.

  • In scale_*_gradient(), the behaviour of midpoint when a trans is applied should be documented (depends on resolution of midpoint is not transformed in scale_color_gradient2 #3198).

  • The current documentation describes scales::censor, which may be worth linking to. scales::squish and scales::squish_infinite can be used here as well, which is not obvious from either the ggplot2 or scales documentation.

  • The parameter documentation for sec.axis in scale_continuous should link to sec_axis() (and possibly be removed from the "see also" section).

  • The links to scales::rescale() aren't active on the site, and it isn't obvious that rescale() isn't a function in ggplot2 (from several scale-related documentation pages).

  • It's worth mentioning that the "Palettes" section in scale_*_brewer() refers to the palette argument (and mention that there is a "Palettes" section in the argument documentation for palette). I know this seems obvious but I've answered this question a few times in tutorials.

  • I'm not sure we need to demonstrate how to change scale label in the examples section for scale_*_brewer(), or the appearance of various scales on a dark background.

  • In scale_(x|y)continuous() there is a link to lims() and labs(), but in scale_(x|y)discrete() there is not.

These are only suggestions, feel free to add to/debate!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions