-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Hi -- Using TerminalExtensions.jl, I've managed to get PyPlot to produce inline images in my terminal. (for screenshots, you can you a look here)
It's not at all clear to me that I'm doing things in the smoothest way possible. Presently, i do something similar to:
julia> import TerminalExtensions
julia> using PyPlot
julia> plot(1:10)
1-element Array{Any,1}:
PyObject <matplotlib.lines.Line2D object at 0x7f7915d0b390>
julia> display(gcf())
<picture shows up here>
I don't find it much of an issue to explicitly call display(gcf()) and in a line by line evaluation environment like a repl, it's probably the only workable solution, but my usage and knowledge of matplotlib is fairly naive.
PyPlot logic seems fairly complicated due to its support of gui backends on the one hand, and IJulia on the other, and so it's not exactly clear to me if there are better ways of doing things. For instance the REPL has preexecute, postexecute, and error hooks similar to IJulia, and so it is possible that the figure logic used in IJulia might be applicable if it were refactored into something generic enough to support IJulia and the inline images in the repl.
I'd be interested in any comments or alternative flows people are using to achieve the same goal. Or perhaps someone will find my way helpful....
Thanks! nehal