Note: In your previous approach inside the @with block you are actually creating a new figure each time, and not just updating the previous figure, hence it will lead to bad performance.
Thanks for the reply - so do you advise against using @with at all? Imagine a case where the df is coming from “somewhere else”, e.g. a file - then x1 etc. would not available as variable and one would have to write first
(; x1, y1, y2) = df
and then repeat the varnames also in the scatter call.
Sure, but that’s a different story…
Are you sure? @macroexpand shows nothing in this direction - mostly just the df. is added where appropriate.
Imagine a case where the df is coming from “somewhere else”
Then I would do the data processing step first and then plot. I’m more in favour of the idea data comes first.
Mixing analysis and plotting in the same workflow is prone to errors, at least for me . This is a personal preference.
Are you sure?
@with df begin
fig=Figure()
only if this is trigger every time there is a new update, not really sure if is activated here , either way I would do the
fig=Figure(); ax = Axis(fig[1,1])
before, just to be sure, plus I think it will be cleaner.