r - 悬停以在 ggplot2 中显示图像或图标(R markdown)
问题描述
我对动态或交互式 ggplot 图很着迷。ggiraph
我在https://davidgohel.github.io/ggiraph/找到了一些简单的悬停选项这是 R 降价的 MWE:
---
title: "Hover"
author: "Author"
output: html_document
---
## Hover ggplot2
```{r, warning=FALSE, message=FALSE}
library(ggplot2)
library(ggiraph)
data <- mtcars
data$carname <- row.names(data)
gg_point = ggplot(data = data) +
geom_point_interactive(aes(x = wt, y = qsec, color = disp,
tooltip = carname, data_id = carname)) +
theme_minimal()
girafe(ggobj = gg_point)
```
将鼠标悬停在降价中的 ggplot 中的数据点上时,是否有可能显示小图像或图标?我想知道如何以及在哪里存储这些图像。我想给每个数据点一个特定的图像。我正在研究著名的画家,即假设我在散点图中只有很少的数据点。因此,当人们将鼠标悬停在“呐喊”上时,他们应该会看到https://en.wikipedia.org/wiki/List_of_most_expensive_paintings#/media/File:The_Scream_Pastel.jpg的小版本
解决方案
推荐阅读
- javascript - JavaScript 中函数的键值对是什么?
- c# - 手动实例化和调用 TagHelper
- ansible - 如果定义了 SHELL (/bin/sh) 环境变量,如何检查 ansible
- mysql - 如何将varchar转换为日期时间,不起作用
- r - R 的包 fracdiff 无法在 Linux Mint 中安装
- android - @BindingAdapter 不适用于 Android Kotlin 库
- json - 如何获取我在firestore中运行json请求的表单部分的字段名称
- memory - nodetool 信息和 java 内存不匹配
- java - 如何从主应用程序运行柑橘测试
- javascript - 获取多次更改内部 HTML 的 ID