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

Remove little bar in printing #13

Open
KronosTheLate opened this issue Dec 27, 2023 · 3 comments
Open

Remove little bar in printing #13

KronosTheLate opened this issue Dec 27, 2023 · 3 comments

Comments

@KronosTheLate
Copy link
Owner

Example output:

julia> compute_dominant_freq(1006)
EasyFFT with 504 samples.
Dominant component(s):              ╷              
   Frequency  │  Magnitude   
╺━━━━━━━━━━━━━┿━━━━━━━━━━━━━╸
     100.40.75522    

On the line with "Dominant component(s):", there is a little bar. I am not sure how to remove it. We use PrettyTables for printing, implemented as shown below:

function show(io::IO, ef::EasyFFT)
    dominant_frequency_indices = finddomfreq(ef)
    table = Term.Table(
        hcat(round.(ef.freq[dominant_frequency_indices], sigdigits=5), round.(abs.(ef.resp[dominant_frequency_indices]), sigdigits=5)), 
        header=["Frequency", "Magnitude"]
    )
    print(io, "EasyFFT with ", length(ef), " samples.\nDominant component(s):", table)
end

Tagging @ronisbr as someone who might know what causes the visual bug.

@ronisbr
Copy link

ronisbr commented Jan 2, 2024

Hi! Is Term.Tableusing PrettyTables.jl?

@KronosTheLate
Copy link
Owner Author

I am so sorry, I must have mixed up Term and PrettyTables in my mind!

But since you are here: do you think that both packages are equally suited for the sole purpose of printing a pretty table when showing a custom struct? Or do you feel like one is superior for whatever reason?

@ronisbr
Copy link

ronisbr commented Jan 2, 2024

No problem! However, I cannot answer that. It is the first time I saw that feature in Term.jl.

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

No branches or pull requests

2 participants