# PrettyTables.jl + Makie.jl

**URL:** <https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707>\
**Category:** Visualization\
**Tags:** makie, prettytables\
**Created:** [August 20, 2021, 5:50am UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707 "2021-08-20T05:50:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bicepjai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicepjai/32/18158_2.png) [@bicepjai](https://discourse.julialang.org/u/bicepjai)\
**Post date:** [August 20, 2021, 5:50am UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/1 "2021-08-20T05:50:14Z")

</div>

Will it be possible to insert [https://github.com/ronisbr/PrettyTables.jl](https://github.com/ronisbr/PrettyTables.jl)  
on an axis ?

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [August 20, 2021, 12:41pm UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/2 "2021-08-20T12:41:29Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 20, 2021, 1:11pm UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/3 "2021-08-20T13:11:19Z")

</div>

> [@hendri54](#):
>
> I’m not sure how to figure out the size of the table, though.

Table size will change with text size:

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

```

---

<div class="post-metadata">

**Author:** ![bicepjai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicepjai/32/18158_2.png) [@bicepjai](https://discourse.julialang.org/u/bicepjai)\
**Post date:** [August 20, 2021, 5:29pm UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/4 "2021-08-20T17:29:50Z")

</div>

That works, but the formatting gets messed up ☹

 ![index](https://global.discourse-cdn.com/julialang/original/3X/0/2/02b56666f739633d914cd88a5936a1955f279551.png)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 20, 2021, 8:38pm UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/5 "2021-08-20T20:38:01Z")

</div>

You should use a monospaced font.

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [March 19, 2025, 9:11am UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/6 "2025-03-19T09:11:36Z")

</div>

Not sure if this requires a new post, but is there a way to make `crayon` formatted table strings work with Makie `text` ?

I know that `text` supports variable styling, but it’s much easier to handle conditional formatting with `PrettyTables`

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [March 19, 2025, 9:25am UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/7 "2025-03-19T09:25:57Z")

</div>

Not PrettyTables per se, but I have this draft for inspiration [Makie table extension by jkrumbiegel · Pull Request #24 · PumasAI/SummaryTables.jl · GitHub](https://github.com/PumasAI/SummaryTables.jl/pull/24)

---

<div class="post-metadata">

**Author:** ![BambOoxX](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bambooxx/32/22179_2.png) [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Post date:** [March 19, 2025, 5:13pm UTC](https://discourse.julialang.org/t/prettytables-jl-makie-jl/66707/8 "2025-03-19T17:13:18Z")

</div>

At least that’s the spirit of what I’d like to do with PrettyTables.
