Skip to content

Continuous scales with manual breaks have incorrect legend ticks #106

@anthonynorth

Description

@anthonynorth

Legend ticks for continuous colour scales aren't functioning correctly when breaks are supplied. This is noticeable when breaks produce a piecewise function which greatly alters the colour mapping.

These should not produce the same legend:

# auto-breaks
scale_color_power(col, limits = -3:3)
# manual-linear-breaks
scale_color_power(col, limits = -3:3, breaks = 0:3)
# manual-breaks-power
scale_color_power(col, limits = -3:3, breaks = breaks_power()(0:3))

These scales have the following form when applied to a 0:1 numeric range:
image

Expected colour legend something like:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions