使用 plotly 时如何反转轴值?

编程入门 行业动态 更新时间:2024-10-09 21:28:30
本文介绍了使用 plotly 时如何反转轴值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我使用的程序:

library(plotly) mydata = read.csv("data_to_plot.txt") df = as.data.frame(mydata) p <- df %>% group_by(X) %>% plot_ly(x = ~Y, y = ~X, z = ~Z, type = "scatter3d", mode = "lines") p

以下是mydata"的摘录:

and below is an excerpt of "mydata":

df[1:12,]X Y Z1 1 0.2818017 0.00059938842 1 0.2832173 0.00078964213 1 0.2846330 0.00102938494 1 0.2860487 0.00132824625 1 0.2874643 0.0016969544

df[1:12,] X Y Z 1 1 0.2818017 0.0005993884 2 1 0.2832173 0.0007896421 3 1 0.2846330 0.0010293849 4 1 0.2860487 0.0013282462 5 1 0.2874643 0.0016969544

我想在 X 轴上反转 X 值,但找不到如何修改我的程序.plotly 语法的细节对我来说非常模糊.有人能提供一些帮助吗?非常感谢.

I would like to have the X values reversed on the X-axis, but can't find how to modify my program. Details of the plotly syntax are quite obscure to me. Could someone afford some help? Many thanks.

绘制的数据:

推荐答案

您可能正在寻找layout(xaxis = list(autorange = "reversed").

You are probably looking for layout(xaxis = list(autorange = "reversed").

更多推荐

使用 plotly 时如何反转轴值?

本文发布于:2023-07-19 13:39:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1157057.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转轴   plotly

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!