I am trying to call a plotting function and return a value from another function (plot_and_return_points(x,y)
):
function plot_stuff(x, y)
plot(x, y)
end
function plot_and_return_points(x, y)
println(“The plot below won’t print, but the points will be returned”)
println(“How do I get the plot to print?”)
plot_stuff(x, y)
return x, y
end
This will return points but not plot
plot_and_return_points(1:10, rand(10))
The values x,y in the code above are returned, but the plot is not shown. I can call the plot_stuff
function and the plot is shown, but I can not call the plot_and_return_points
function to display the plot.
What am I missing?