-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Description
Hello. I'm trying to add a text to the plot with the following code
fonts := font.NewCache(liberation.Collection())
plot.DefaultTextHandler = text.Latex{
Fonts: fonts,
}
labels, err := plotter.NewLabels(plotter.XYLabels{
XYs: []plotter.XY{
{X: 0, Y: 0},
},
Labels: []string{
"Money % spent today: 10",
},
})
if err != nil {
log.Fatalf("could not create labels: %+v", err)
}
labels.TextStyle[0].Font.Size = 24
labels.TextStyle[0].Color = color.RGBA{B: 255, A: 255}
labels.TextStyle[0].XAlign = draw.XCenter
labels.TextStyle[0].YAlign = draw.YCenter
p.Add(labels)code was taken from the example https://github.com/gonum/plot/blob/master/text/latex_example_test.go
But I get nothing on the plot except Money. Like % sign cuts everything else.
Could anyone give a hint on how to add a % sign to a string?
Metadata
Metadata
Assignees
Labels
No labels