In python matplotlib, it is possible to define a figure and its axes in variables; then progressively add different types of plots to that one variable/change that plot's parameters throughout the code by refering to those variables.
Is there anything similar in Julia (use a variable to reference some plot to add datasets to it). And does it have some kind of special treatment of data frames?
I know there is something similar, where you can use plot!(myPlot, some new data), but what if I wanted to use a scatter? Would it work the same way?
Is this compatible with the @df operator? (where you generate a plot via something like:
@df plotDat2 plot(:a,:b);
I suggest the AlgebraOfGraphics package. It allows you to plot data frame columns with very nice syntax similar to what you have written. Typically, with AlgebraOfGraphics you do not need to interact with the figure and axes directly, but that is possible since AlegbraOfGraphics is built on top of the Makie package. You could also just use Makie directly if you like building the figures and axes objects manually. It just does not have the same convenience for working with data frames.