0
votes

Using Plotly in Julia, I would like to filter the plot data based on the selection event for a dropdown as shown in the example for the similiar case with Plotly in Python that I reproduce here:

enter image description here

I went through the PlotlyJS.jl documentation but could not find how to do it. Is filtering based on dropdown selections currently not supported in Plotly for Julia or am I missing something?

1

1 Answers

1
votes

you can use Interact.jl and Plots.jl for this

using Interact, Plots
some_dataset  = rand( 10, 2)
other_dataset = rand( 10, 2)
datasets=Dict(:some  => some_dataset,
              :other => other_dataset)
@manipulate for dataset = [:some, :other]
    scatter(datasets[dataset])
end

Do mind that this will display a multiple-choice widget that's not a drop-down menu, but serves the same purpose. Check the Interact docs for precise information on how to use a drop-down instead.