Add Dollar Signs to Axis

Try escaping the dollar sign with a backslash like this:

using Gadfly, Printf
plot(x=rand(10)*10_000, y=rand(10)*10_000,
       Scale.x_continuous(labels=x -> @sprintf("\$% dk", x/1000)),
       Scale.y_continuous(labels=x -> @sprintf("\$% dk", x/1000)))

Which for me produces:

The backslash is to prevent Julia to interpret the dollar sign as interpolation of another string.

1 Like