如何在 Julia 中制作交互式情节

Moh*_*aad 4 plot interactive julia plotly

我正在尝试在交互式绘图上绘制时间序列数据,以便我可以放大数据以进行详细观察。我的基本情节的主要代码是,

using IterableTables, DataFrames, CSV, Dates, TimeSeries, Plots

myfile="test2.csv"
dmft = dateformat"d/m/yyyy HH:MM:SS"
println(dmft)
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile); dateformat=dmft))
df2 = filter(row -> row[:Date] <= Dates.DateTime("2020-10-15T00:06:00"), df)

x = convert(Matrix, df[:, [:Date]])
y = convert(Matrix, df[:, [:Col3]])

Run Code Online (Sandbox Code Playgroud)

#我放置了常用的绘图函数,我已为此块删除了该函数`

请有人建议我如何在交互式绘图上绘制这两列?

先感谢您。

lun*_*ben 9

Plots.jl 的plotlyjs 后端允许交互式缩放等。代码应该是(我现在无法测试):

using Plots
plotlyjs()
plot(x, y)
Run Code Online (Sandbox Code Playgroud)

我经常在 Pluto 笔记本中使用它,您可以在其中添加 PlutoUI 元素(如滑块、选择框)以进行交互式过滤/数据探索。