I suppose this will do?
using IOCapture, Malt, Plots
worker=Malt.Worker()
Malt.remote_eval(worker, :(using IOCapture, Plots))
results=Malt.remote_eval_feth(worker, quote
IOCapture.capture() do
println("Creating plot")
return scatter([1,2,3], [4,5,6])
end
end)
julia> results.output
"Begin creating plot\n"
julia> results.value
# returns the plot
Your code is likely to be long, so it’d be better to use the quote block.
Wrap your code inside IOCapture.capture and make sure you return the plot in the end, and I’m pretty sure you’ll get what you want.