这是indexloc提供的服务,不要输入任何密码
Skip to content

tm_intervals: Legend labeling at intersections of colors #1175

@rabons

Description

@rabons

I am looking for a way to place the legend labels in tm_scale_intervals() at the intersection of colors, instead of in their middle: Labelling boundaries for color changes instead of bins. For example in the Happy Planet Index figure from the tmap v4 introduction (https://r-tmap.github.io/tmap/articles/01_tmap_intro_v4.html#suggestions), instead of labelling "1 to 2", "2 to 3" etc., label 0, 1, 2, 3 etc., such as in tm_scale_continuous(), but while retaining a discrete color scale.

This could be highly useful for the use of tmap in the physical climate sciences, which typically use discrete color scales with labeling as in tm_scale_continuous(). Often, the cartopy Python package is used there.

I understand this may be a bigger change to the code. Any help appreciated. May be there is a workaround, or specific lines of code that would need adaptation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions