Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two questions related to shapes #15

Open
Nowosad opened this issue Nov 10, 2020 · 1 comment
Open

Two questions related to shapes #15

Nowosad opened this issue Nov 10, 2020 · 1 comment
Assignees

Comments

@Nowosad
Copy link
Member

Nowosad commented Nov 10, 2020

@mtennekes two open questions:

  1. Shapes for symbols: they work for both categorical and sequential data. However, should they work for sequential data?
  2. Shapes (lty) for lines: right now it is only possible to set one line type for all of the data. Would it be possible to allow to provide a categorical variable here?
library(tmap)
data("rivers", package = "tmap")
data("metro", package = "tmap")
set.seed(222)
metro2 = metro[sample(1:nrow(metro), 30), ]
set.seed(231)
metro2$group = as.character(sample(1:3, size = nrow(metro2), replace = TRUE))

# 1 -----------------------------------------------------------------------
# works
tm_shape(metro2) +
  tm_symbols(shape = "group")
#> Linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.2

# also works - but should it?
tm_shape(metro2) +
  tm_symbols(shape = "pop1950")
#> Warning: Not enough symbol shapes available. Shapes will be re-used.

# 2 -----------------------------------------------------------------------
# works
tm_shape(rivers) + 
  tm_lines(lty = 2)

# does not work
tm_shape(rivers) + 
  tm_lines(lty = "type")
#> Error in grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow): invalid hex digit in 'color' or 'lty'

Created on 2020-11-10 by the reprex package (v0.3.0)

@mtennekes
Copy link
Member

This is something to look at for v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants