r - 如何使用plot_ly在R中的轮廓线上赋值

标签 r plotly contour

我正在 R Studio 中使用 plot_ly 来绘制等高线图。我希望等高线直接在图表上显示它们的值(类似于此处的图像: http://www.cyber-wit.com/onlineHelp/Images/contour.png )。我不知道如何实现这一点。 这是我的代码:

plot_ly(width = 600, height = 600,
      type = 'contour',
      z=Matrix_Contour,
)

感谢您的帮助!

最佳答案

为此,您需要showlabels = TRUE:

plot_ly(z = volcano, type = "contour", contours = list(showlabels = TRUE))

enter image description here

关于r - 如何使用plot_ly在R中的轮廓线上赋值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54508363/

相关文章:

r - Shiny - 在 Ui.R 中检测输入变化并发出警告

r - 如何使用强制转换或其他函数在 R 中创建二进制表

javascript - 将绘图中的数据保存到 csv 或 excel 文件中

python - 在视频中的对象上创建边界框

python - 在 matplotlib 中将 hist2d 输出转换为轮廓

r - 在许多列中应用和运行 gsub

r - 使用 facet_grid 有条件地更改面板背景?

r - Plotly map 不在 R 中渲染

r - 使用 plotly 中的标记将抖动添加到箱线图

c++ - 如何实时找到 OpenCV 轮廓的平均强度