我怎样才能R中使用plot_ly分配上轮廓线值

问题描述 投票:2回答:1

我正在使用中的R工作室plot_ly绘制的等高线图。我想轮廓线,直接在图上显示它们的值(像这里的图片:http://www.cyber-wit.com/onlineHelp/Images/contour.png)。我不知道如何实现这一目标。这里是我的代码:

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

谢谢您的帮助!

r plotly contour
1个回答
3
投票

为此你需要showlabels = TRUE

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

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.