geom_text
using TidierPlots
using DataFrames
df = DataFrame(
x = [1,1,2,2],
y = [1,2,1,2],
t = ["A", "B", "C", "D"]
)
4×3 DataFrame
Row | x | y | t |
---|---|---|---|
Int64 | Int64 | String | |
1 | 1 | 1 | A |
2 | 1 | 2 | B |
3 | 2 | 1 | C |
4 | 2 | 2 | D |
geom_text¤
ggplot(df, @aes(x=x, y=y, text=t, color=t)) + geom_text()
ggplot(df, @aes(x=x, y=y, text=t, color=t)) +
geom_text(fontsize=24, align=(:left, :bottom), font=:bold) +
geom_point() +
lims(x = (0, 3), y = (0, 3))
geom_label¤
ggplot2 deviation
Currently this method is the same as geom_text
, and does not put the text in a rectangle like in ggplot2
.
ggplot(df, @aes(x=x, y=y, text=t, color=t)) + geom_label()
ggplot(df, @aes(x=x, y=y, text=t, color=t)) +
geom_label(fontsize=24, align=(:left, :bottom), font=:bold) +
geom_point() +
lims(x = (0, 3), y = (0, 3))
This page was generated using Literate.jl.