Add 3D scatter.

e_scatter_3d(e, y, z, color, size, bind, coord.system = "cartesian3D",
  name = NULL, rm.x = TRUE, rm.y = TRUE, legend = FALSE, ...)

e_scatter_3d_(e, y, z, color = NULL, size = NULL, bind = NULL,
  coord.system = "cartesian3D", name = NULL, rm.x = TRUE,
  rm.y = TRUE, legend = FALSE, ...)

Arguments

e

An echarts4r object as returned by e_charts.

y, z

Coordinates.

color, size

Color and Size of bubbles.

bind

Binding.

coord.system

Coordinate system to use, one of geo3D, globe, or cartesian3D.

name

name of the serie.

rm.x, rm.y

Whether to remove x and y axis, defaults to TRUE.

legend

Whether to add serie to legend.

...

Any other option to pass, check See Also section.

See also

Examples

v <- LETTERS[1:10] matrix <- data.frame( x = sample(v, 300, replace = TRUE), y = sample(v, 300, replace = TRUE), z = rnorm(300, 10, 1), color = rnorm(300, 10, 1), size = rnorm(300, 10, 1), stringsAsFactors = FALSE ) %>% dplyr::group_by(x, y) %>% dplyr::summarise( z = sum(z), color = sum(color), size = sum(size) ) %>% dplyr::ungroup() matrix %>% e_charts(x) %>% e_scatter_3d(y, z, size, color) %>% e_visual_map( min = 1, max = 100, inRange = list(symbolSize = c(1, 30)), # scale size dimension = 3 # third dimension 0 = x, y = 1, z = 2, size = 3 ) %>% e_visual_map( min = 1, max = 100, inRange = list(color = c('#bf444c', '#d88273', '#f6efa6')), # scale colors dimension = 4, # third dimension 0 = x, y = 1, z = 2, size = 3, color = 4 bottom = 300 # padding to avoid visual maps overlap ) airports <- read.csv( paste0("https://raw.githubusercontent.com/plotly/datasets/", "master/2011_february_us_airport_traffic.csv") ) airports %>% e_charts(long) %>% e_globe( environment = e_stars_texture(), base.texture = e_globe_texture(), globeOuterRadius = 100 ) %>% e_scatter_3d(lat, cnt, coord.system = "globe", blendMode = 'lighter') %>% e_visual_map(inRange = list(symbolSize = c(1, 10)))