Hi David. I didn't realize you posted here as well. I'll copy/paste my response from gitter in case it helps anyone else:
this is certainly a feature that matches julia style. Just as with any > other type, when a Plot object is returned to the REPL it is displayed. A > semicolon suppresses this. If building a Plot object is part of a function > call or script and not explicitly returned, the assumption is that you > don't want the display side effects (again this is a feature... Many times > you really don't want to display on every call to plot/plot!) > All that said, there is the 'show = true' option that you can pass in, and > you can always set that default value when you load in: using Plots; > pyplot(show = true) > This should give you the behavior you're looking for On Sat, May 21, 2016 at 9:57 PM, David Parks <[email protected]> wrote: > The following examples will fail to open a plot window in the REPL > (notably without warning or error, making it devilishly hard to > troubleshoot). > > using Plots # This is common to all > plotting platforms as far as I know > function test(); plot(); print(); end > test() # Fails to plot, returns with > no result > > plot(); # Fails to plot, returns with > no result > > The solution is to do: > > display(plot()) # Works in all cases > > I understand and support the desire to provide output suppression (I code > in matlab most often and am very familiar with that feature). > > However to default to UI windows being blocked seems like very > un-intuitive behavior to me. And this is not the way matlab handles UI > windows, semicolon or not, UI windows are displayed. > > Furthermore, the result of simply adding a semicolon to plot, or adding a > print statement after it in a function is that it silently fails, and in an > unexpected/unintuitive way. > > Is there a good reason for UI functions to be blocked like this? Or is it > something that should be a feature request? >
