【问题标题】:PlotlyJS in Julia : xaxis settingJulia 中的 PlotlyJS:xaxis 设置
【发布时间】:2019-10-22 00:52:44
【问题描述】:

我想在三维坐标系中画一些点,对x、y、z轴显示的范围做一些调整。

比如x轴的范围设置为-1~8(但是绘制点的x坐标范围只有1~2),我尝试了下面的代码但是不行:

node_date = DataFrame(A = node_x,B = node_y,C = node_z)
data = scatter3d(node_date,x =:A,y =:B,z = :C,mode="markers")
layout = Layout(xaxis_range=[-1, 8])
plot(data,layout)

如果上面的代码改成二维图,就生效了。 我现在应该如何修改程序?

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)
Environment:
  JULIA_EDITOR = "C:\Users\huoze\AppData\Local\atom\app-1.38.0-beta0\atom.exe"  -a
  JULIA_NUM_THREADS = 2

【问题讨论】:

    标签: julia plotly plotly.js


    【解决方案1】:

    尝试修改scenexaxis,而不是Layout 中的xaxis_rangeattr

    而不是

    layout = Layout(xaxis_range=[-1, 8])
    

    使用

    layout = Layout(;scene=attr(;xaxis=attr(;range=[-1, 8])))
    

    灵感:https://plot.ly/javascript/3d-axes/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-24
      • 2019-04-15
      • 2017-05-31
      • 2020-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多