Q: PyPlot "plot()" function fails in julia 0.4.5 on Ubuntu 16.04 I am working with a program that is meant to take a few parameters and use a genetic algorithm to optimize a five-layer mirror coating according to said parameters. Just before termination, the program is meant to display a plot of the theoretical reflectivity of the mirror over a range of wavelengths. The last four lines of the program are:
plot(lam,rf)
xlabel("wavelength(AA)")
ylabel("reflectivity")
title("Broadband reflectivity")

When I run this from the command line (sudo julia Broadband.jl), the plot never displays; I put a few println() functions in there and there is output just before and just after plot(lam,rf).
Perhaps the strangest part is the fact that I copied the entirety of the code, pasted it to the terminal and ran it directly from julia (julia> [ENTIRETY OF .JL FILE]), and the plot displayed. Does anyone know what I'm missing?

A: Please note the following from the PyPlot README:

If you use PyPlot from an interactive Julia prompt, such as the Julia command-line prompt or an IJulia notebook, then plots appear immediately after a plotting function (plot etc.) is evaluated.
However, if you use PyPlot from a Julia script that is run non-interactively (e.g. julia myscript.jl), then Matplotlib is executed in non-interactive mode: a plot window is not opened until you run show() (equivalent to plt.show() in the Python examples).

Thus, you must call show() for your plot to display when run from the command line.
