在plot_ly曲面图上标记x、y和z轴(R)
我有以下几行代码用于绘制曲面
fig<-plot_ly(z=~MatDurMat,y=~MatDurAxis[,1],x=~MatDurAxis[,2],type = "surface")
%>% layout(xaxis=list(title='Discount rate'), yaxis=list(title='Initial carbon price (£)'))
fig
它可以很好地绘制曲面,但尽管没有出现任何错误,轴标题显示为 MatDurMat、MatDurMat[,1] 和 MatDurMat[,2],而不是我在布局部分指定的。
提前致谢。
I have the following lines of code for plotting a surface
fig<-plot_ly(z=~MatDurMat,y=~MatDurAxis[,1],x=~MatDurAxis[,2],type = "surface")
%>% layout(xaxis=list(title='Discount rate'), yaxis=list(title='Initial carbon price (£)'))
fig
It plots the surface just fine, but despite not getting any errors, the axis titles show up as MatDurMat, MatDurMat[,1], and MatDurMat[,2], as opposed to the ones I have specified in the layout section.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以做到:
由 reprex 包于 2022 年 3 月 1 日创建 (v2.0.1)
注意,您需要将
scene
用于 3d 轴。This should do it:
Created on 2022-03-01 by the reprex package (v2.0.1)
Note, you need to use
scene
for 3d axes.