PrettyTables.jl + Makie.jl

Will it be possible to insert GitHub - ronisbr/PrettyTables.jl: Print data in formatted tables.
on an axis ?

If you are looking for a text formatted table, PrettyTables can return a table as a String, which can be plotted with text:

using CairoMakie, FileIO, PrettyTables

fig = Figure();
ax = fig[1,1] = Axis(fig);
xlims!(ax, -1, 5);
ylims!(ax, 0, 2);
hidespines!(ax);
hidedecorations!(ax);

pt = pretty_table(String, rand(4,3); header = ["a", "b", "c"]);
text!(ax, pt; font = "JuliaMono");

I’m not sure how to figure out the size of the table, though.

2 Likes

Table size will change with text size:

text!(ax, pt; font = "Hack", textsize = 10);

That works, but the formatting gets messed up :frowning:

You should use a monospaced font.

1 Like