Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display() #1230

Closed
montyvesselinov opened this issue Dec 23, 2018 · 2 comments · Fixed by #1232
Closed

display() #1230

montyvesselinov opened this issue Dec 23, 2018 · 2 comments · Fixed by #1232

Comments

@montyvesselinov
Copy link

montyvesselinov commented Dec 23, 2018

old versions of Gadfly for julia 0.6,4 were producing plots that can be plotted by TerminalExtensions.jl in the REPL. The new versions for 0.7 & 1.0 cannot do this.

Function as this is needed:

function display(p::Gadfly.Plot)
Gadfly.draw(Gadfly.PNG(), p)
println()
end

can you add something like this in the code?

@bjarthur
Copy link
Member

it still plots in the browser for me when using iTerm2:

julia> using TerminalExtensions

julia> using Gadfly

julia> function display(p::Gadfly.Plot)
       Gadfly.draw(Gadfly.PNG(), p)
       println()
       end
display (generic function with 1 method)

julia> plot(y=[1,2,3])

@montyvesselinov
Copy link
Author

montyvesselinov commented Dec 29, 2018

To extend Base.display, Base.display should be imported first.

    import Gadfly
    import Cairo, Fontconfig
    import Base: display
    function Base.display(p::Gadfly.Plot)
        Gadfly.draw(Gadfly.PNG(), p)
        print("\r")
    end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants