-
-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] can't display dollar currency symbol as y-axis label #3991
Comments
Some more experiments: julia> plot(rand(3,5),ylabel=raw"profits $")
ERROR: syntax error
ERROR: syntax error
ERROR: syntax error
ERROR: syntax error
ERROR: syntax error
julia> plot(rand(3,5),ylabel=raw"profits $")
ERROR: syntax error
ERROR: syntax error
ERROR: syntax error
ERROR: syntax error
ERROR: syntax error
julia> GR.plot(rand(3,5),ylabel=raw"profits $")
ERROR: syntax error
ERROR: syntax error
julia> GR.plot(rand(3,5),ylabel="profits \$")
ERROR: syntax error
ERROR: syntax error
julia> GR.plot(rand(3,5),ylabel=raw"profits $")
ERROR: syntax error
ERROR: syntax error A work around was too embed unusual unicodes characters that look like dollars but I then run into fonts supporting glyph problems. |
plottlyjs() works correctly. julia> plotlyjs()
Plots.PlotlyJSBackend()
julia> plot(rand(3,5),ylab="profits \$")
julia> gr()
Plots.GRBackend() |
@jheinen: Anything we can do about it? |
Right now (with the GR development branch), the only workaround is to use |
When some more words follow using Plots
plot(rand(3,5),ylabel="profits \$/kWh", size=(500, 200)) In the above, it seems that "kWh" was treated as in an equation environment. As @jheinen mentioned, |
This problem is fixed in the GR development tree. We will tag a new GR release ASAP. |
Fixed by sciapp/gr@f37dfaa. |
So how do I put dollar signs in axis labels now that this is "fixed"? As of now, Doing
into stdout and puts a weird backslash where the first dollar sign should be Update: I came up with a hack to get what I want. Everywhere you want a literal dollar sign, put two. Then, tmppath, tmpio = mktemp()
open("filename.svg") do file
for line in eachline(file, keep=true)
write(tmpio, replace(line, raw"$$" => raw"$"))
end
end
close(tmpio)
mv(tmppath, "filename.svg", force=true) |
Details
When I run the following code:
while the euro unicode symbol will work beautifully
Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version:
Plots v1.25.1
Output of
versioninfo()
:Julia Version 1.6.3
Commit ae8452a9e0 (2021-09-23 17:34 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
The text was updated successfully, but these errors were encountered: