如题,我想绘制一个三维气泡图,代码如下
library(echarts4r)
quakes |>
e_charts(x = lat) |>
e_scatter_3d(
y = long, z = depth,
size = mag,
color = mag,
bind = stations,
coordinate_system = "cartesian3D",
name = "Fiji"
) |>
e_x_axis_3d(min = -40, max = -10, name = "纬度") |>
e_y_axis_3d(min = 165, max = 190, name = "经度") |>
e_z_axis_3d(name = "深度") |>
e_visual_map(
serie = mag,
type = "continuous",
inRange = list(color = c('#4B0055', '#009B95', '#FDE333')),
dimension = 4, # third dimension x = 0, y = 1, z = 2, color = 3, size = 4
top = 20
) |>
e_visual_map(
serie = mag,
type = "continuous",
inRange = list(symbolSize = c(10, 30)),
dimension = 3,
bottom = 10
) |>
e_tooltip() |>
e_title(text = "斐济及其周边地震活动")
目前的效果如下
很奇怪,为什么两个视觉映射效果冲突了呢?图中的点小得不能再小了。
我怀疑是 echarts4r 的 BUG,给 echarts4r 提交了 BUG 报告,不过维护者似乎很久没来打理了,我就来论坛求助了。
环境信息
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] zh_CN.UTF-8/zh_CN.UTF-8/zh_CN.UTF-8/C/zh_CN.UTF-8/zh_CN.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] echarts4r_0.4.4
loaded via a namespace (and not attached):
[1] Rcpp_1.0.9 magrittr_2.0.3 tidyselect_1.1.2.9000
[4] xtable_1.8-4 R6_2.5.1 rlang_1.0.6
[7] fastmap_1.1.0 fansi_1.0.3 dplyr_1.0.99.9000
[10] utf8_1.2.2 cli_3.4.1 withr_2.5.0
[13] htmltools_0.5.3 ellipsis_0.3.2 yaml_2.3.5
[16] digest_0.6.29 tibble_3.1.8 lifecycle_1.0.3
[19] shiny_1.7.2 later_1.3.0 htmlwidgets_1.5.4
[22] vctrs_0.4.2.9000 promises_1.2.0.1 glue_1.6.2
[25] mime_0.12 compiler_4.2.1 pillar_1.8.1
[28] generics_0.1.3 jsonlite_1.8.2 httpuv_1.6.6
[31] pkgconfig_2.0.3
参考材料
- 统计之都文章 echarts4r: 从入门到应用 之 视觉映射
- echarts4r 官网三维气泡图示例
- echarts 官网三维气泡图示例