Edit or run this notebook

Plots.jl click input

Click somewhere on this graph:

9.5 Î¼s
11.2 s
200 ns
linepoint (generic function with 1 method)
22.1 Î¼s

Why is this special? Because normally, the input (@bind) and output live in two separate cells:

7.7 Î¼s
12.2 ms
missing
100 ns

But in our interactive plot, the input and output are inside the same cell. To achieve this, we need a couple of tricks: a click tracker wrapper, a self-referencing cell and the @initially macro. Let's talk about those one by one:

Click tracker

TUTORIAL WORK IN PROGRESS

13.9 Î¼s
COOL_PLOT (generic function with 1 method)
23.3 Î¼s

The third step is to write a function that:

  • takes a click coordinate (a vector [x, y]) as input, and

  • returns a plot.

It's up to you to use this coordinate in a creative way!

15.9 Î¼s

Necessary functions

You can copy these cells into your notebook by selecting them (start dragging a selection rectangle from inbetween two cells), and dragging them into another notebook.

5.1 Î¼s
plotclicktracker (generic function with 1 method)
92.6 Î¼s
intially_function (generic function with 1 method)
65.7 Î¼s

You can also use ingredients to load this notebook into another notebook.

6.5 Î¼s

Packages

(We only need Plots.jl)

4.4 Î¼s
7.1 s
Loading...i