R 绘图与绘图:更改 2dHeatMap 的比例值

发布于 2025-01-10 23:44:21 字数 422 浏览 0 评论 0原文

我使用以下几行在 R 中使用 plotly 绘制热图:

plot_ly(data, x , y) %>% add_trace(type='histogram2dcontour')

然后我获得了以下图 1

数据实际上看起来像散点图上的那样 2

如您所见,我在热图上丢失了很多点。我想知道如何手动设置热图颜色的比例,以便每次计数增加 10 而不是 100 时颜色都会发生变化。

否则,是否有更好的方法来绘制和可视化此类数据?

I used the following lines to plot a heatmap with plotly in R:

plot_ly(data, x , y) %>% add_trace(type='histogram2dcontour')

I then obtained the following plot
1

The data actually looks like that on a scatter plot
2

As you can see, I lose a lot of points on the heatmap. I was wondering how I could manually set the scale for the colour of the heatmap for e.g. making it so that the colour changes every time the count increase by 10 instead of 100.

Otherwise, is there a better way to plot and visualize such data?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文