Interactive plotting from the REPL?

Goal is to do some interactive plotting from the REPL on linux (not using an Atom or Jupyter web browser)

Previously I made the Fatou.jl package and I would like to make an interactive plot inspired by the repo:

Have a look at their GIF in the readme for the interactive plotting visualization example.

Is this something that can be accomplished from the REPL plotting in Julia somehow?

2 Likes

Iā€™m not sure what you mean with ā€œfrom the REPLā€ but it seems that Makie would be good for this since it should update the canvas quickly and handle mouse events.

2 Likes

What I mean is that I donā€™t want to run Julia from Juno or Atom or Jupyter, I want to interactively plot from the REPL in the standard unix environment without using any web-browser interfaces.

Can Makie be used without the web browser interface? Iā€™d prefer something like a Qt popup window.

Makie just pops up a render window like any other plotting / GUI tool.

5 Likes

There are two Mandelbrot examples and one Julia set example in the examples section of GR.jl - two plain Julia scripts (mandel.jl, julia.jl) and an OpenCL accelerated Mandelbrot script.

1 Like

Gaston works this way. It can plot arrays as a set of points, so it can plot fractals if you store them as arrays.

What about making the plot interactive?

I already know I can plot fractals in plotting packages.

To answer my question you would also have to take the interactivity into account, like mouse hover and click and drag and so onā€¦ can they do that? Please show how I would make an interactive plot that updates with click and drag coordinate parametric interactivity.

For example, placing dots into the plot and clicking and dragging them into to new configurations. The plot should be re-computed with the new configurations.

Yeah, Gaston (or rather, gnuplot) is not designed to do that. It wasnā€™t clear to me from your question and comments what you meant by ā€˜interactiveā€™.

InspectDR written in Julia, so you can add interactivity if you wish.

It was not designed to hook in custom callbacks yet, but you can use ā€œdynamic patchingā€ (guerrilla patch/monkey patch) to ā€œhackā€ in your own hooks at the moment.

You can find an example of this here:

Note that it might be more appropriate to overwrite the callback functions instead of the handleevent_mousepress() function. I can guide you through that if you want.

Limitations

InspectDR does not support heat map or contour plots - so you probably donā€™t want to use it for drawing fractals. But it does work fine for 2D line plots.

Layered design

InspectDR typically is used as a plot application, but you could also instantiate an individual InspectDR plot widget within your custom, interactive Gtk application.

ā€¦But if you want to do that, you might want an overview of how the code was divided into files. I will only do that if you ask, I donā€™t feel like explaining this for nothing.