# Seven Lines of Julia (examples sought)

**URL:** <https://discourse.julialang.org/t/seven-lines-of-julia-examples-sought/50416>\
**Category:** General Usage\
**Created:** [November 19, 2020, 7:37am UTC](https://discourse.julialang.org/t/seven-lines-of-julia-examples-sought/50416 "2020-11-19T07:37:29Z")\
**Posts on this page:** 1\
**Showing post:** 184

<div class="post-metadata">

**Author:** ![Syx\_Pek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/syx_pek/32/6364_2.png) [@Syx\_Pek](https://discourse.julialang.org/u/Syx_Pek)\
**Post date:** [July 31, 2022, 5:01pm UTC](https://discourse.julialang.org/t/seven-lines-of-julia-examples-sought/50416/184 "2022-07-31T17:01:50Z")

</div>

I know this is more than seven lines, but like above in the spirit of the thread.  
(It’s seven lines if you ignore the setup and cleanup 😛)

```julia
using Term, REPL, UnicodePlots

begin
    t, N, Fn = REPL.TerminalMenus.terminal, 0, "15sinc(√(x^2 + y^2) / π)"
    REPL.Terminals.raw!(t, true), print(stdout, "\x1b[?25l")
    io = IOContext(PipeBuffer(), :color=>true)
    while true
        println(io, Panel(string(surfaceplot(-8:8., -8:8., eval(Meta.parse("(x, y) ->"*Fn));
            azimuth = mod(N, 360) - 180, zoom = 1.25, colormap = :jet, lines=true);
            color = true); fit = false, padding= (0, 0, 2, 2), title = Fn, width = 90, 
            justify = :center, subtitle = "[j]/[l] to rotate, [q] to quit", subtitle_justify=:right))
        REPL.Terminals.clear(t); println(read(io, String))
        c = read(stdin, Char);
        c == 'q' && break; c == 'j' && (N += 10); c == 'l' && (N -= 10)
    end
    REPL.Terminals.raw!(t, false), print(stdout, "\x1b[?25h")
end

```

This yields (the picture loses a little, it is interactive!)

 ![2022-08-01-00:59:41-screenshot](https://global.discourse-cdn.com/julialang/original/3X/3/0/301f9c9a63e7ce0561886719e860535563a10b64.png)

Code partially taken from: [[ANN] UnicodePlots.jl v2.8.0 - 3D plots](https://discourse.julialang.org/t/ann-unicodeplots-jl-v2-8-0-3d-plots/75963)

---

_[View the full topic](https://discourse.julialang.org/t/seven-lines-of-julia-examples-sought/50416)._
