Closed ziotom78 closed 3 years ago
I am glad you like it, that motivates me to continue working on it!
When you call plot
in the REPL, that function will return an object and the REPL will then call display
on it. So in your script you have to explicitly call display
:
f(x) = 3exp(x)
x = 0.0:0.1:1.0
plot(x, f.(x))
display(plot(x, f.(x)))
println() # note the additional println statement
println("Minimum value: ", f(0.0))
println("Maximum value: ", f(1.0))
I also added a println()
as otherwise the newline character that is produced when pressing return in the repl is missing and that leads to some weird formatting.
As a side note, you can also call plot(f, x)
instead of plot(x, f.(x))
Thank you @simonschoelly , it worked like a charm! If you agree, I can create a PR to explain this trick in the README, in the section named «Usage». I believe it would be useful for other people as well.
Thanks for this package, I really love it! I am using it extensively for my daily work, and it has been a great time-saver!
There is one issue I have not been able to solve yet: suppose I have a script that performs calculations and creates plots, like this one:
Since the
plot
command is not the last in the script, the plot is not produced and the output is justI am quite sure that the problem is easy to solve, yet I have not been able to understand why!