I’m using CairoMakie to make a heatmap in Julia 1.7.3
I’d like to add a single smiley face (or really any marker) in the very center of the heatmap, at say 50 x 50.
This seems like a super simple task, but I’ve been looking online and haven’t found anything. The most basic thing to do would seem to be use scatter, which I can make work if I have multiple points, but not if I only want to put one.
I think your single points just need to be wrapped in a vector:
using CairoMakie
fig = Figure()
ax = Axis(fig[1, 1])
heatmap!(ax, rand(4, 4))
scatter!(ax, [2.5], [2.5]; marker='😃', markersize=100)
# Can also use a Point
scatter!(ax, Point(3.5, 1.5); marker='😃', markersize=100)
fig
Is there a reference somewhere showing the relationship between Point, Point2, and Point2f by the way? I think I saw that Point2f0 was deprecated at some point (no pun intended), but I have trouble keeping them all straight to be honest
Basically, there are two factors at play - the font and the rendering system. A lot of fonts don’t explicty support empjis, or have simple vector forms as opposed to the complex emojis we are used to.
Furthermore, in GLMakie we render all text in a specific way (signed distance fields) which allows a glyph to be rendered smoothly but loses the color information.
These two factors mean that Makie is not necessarily that good at rendering emojis. If you find a good font, CairoMakie may do better.
Cairo cannot render such multicolor glyphs at all. They’d require bit of a special treatment, and as Anshul said, GLMakie’s pipeline can only handle single color anyway. So it’s not likely to ever be added. However if one truly needed to plot emoji markers, one could always get their hands on bitmaps and plot these as scatter markers.
Thanks. As I said, this was out of curiosity because what was plotted was not the emoji itself but simplification of it. I think Cairo is not so different of GMT (which has its own PostScript library) and in it we can make symbols out of any postscript file, so plotting emojis would be a matter of creating PS versions of them.