Skip to content

Which value.na color: (manually set) option or color scale default? #1201

@mtennekes

Description

@mtennekes

Each cols4all color palette has a specific color for NAs. By default this value is used rather than the tmap option.

However, what if the user deliberately set the option to make it a different color?

vna = tmap_options("value.na")
lobstr::tree(vna)
vna$value.na$fill = "yellow"

tmap_options(vna)
tmap_options_save("my_theme")

tmap_style()

# no yellow for NA
tm_shape(World) + 
  tm_crs("auto") +
  tm_polygons(
    fill = "HPI"
 ) 


# yellow for NA
tm_shape(World) + 
	tm_crs("auto") +
	tm_polygons(
		fill = "HPI",
		fill.scale = tm_scale(values = cols4all::c4a("-hcl.blues3", 5))
	) 

So ideally, somewhere it should be specified whether to take the palette NA color or the tmap option value.na....

Metadata

Metadata

Assignees

No one assigned

    Labels

    ColorsIssues related to color/fill/etc
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions