-
-
Notifications
You must be signed in to change notification settings - Fork 358
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] Making sure label display is predictable #4514
Comments
My opinion on this is that we need unification of preprocessing strings so that this cannot error out. This seems to be julia> using Plots
julia> plot(1:10, xlabel="\$")
cc @jheinen. |
In https://github.com/JuliaPlots/Plots.jl/blob/master/src/backends/gr.jl#L257-L263: julia> GR.textext(..., "\$") # produces a '$' char, but also "ERROR: syntax error"
julia> GR.text(..., "\$") # no character appears, and "ERROR: syntax error" shown |
I don't understand 19b70c0: shouldn't |
I think the intention is to return |
They way I think this should work (and that is how it is implemented in the pgfplotsx-backend) is that if you pass a plain string, you should get the characters displayed that are in the string and if you want LaTeX-like strings you need to pass So the processing in the gr-backend would need to substitute every |
Can't at least Why are people keeping up with the archaic At least that would be easier to parse and less error prone: julia> plot(1:2, title=raw"I have \(\sqrt{2}\) $ in my pocket") |
I'm currently out of office - I will take care of it this afternoon. |
The "archaic" |
According to https://tex.stackexchange.com/a/513/75098, no. And no it's pretty common: https://overleaf.com/learn/latex/Mathematical_expressions ( In our context where parsing occurs (and obviously because it chokes on a singleton At least the example in #4514 (comment) would be un-ambiguously parsed. Side note: I'm not talking about display math mode |
Thanks for the clarification. I will have to change things in the GR tun-time, too. It's not just about |
The above mentioned problems are fixed in the GR run-time development tree. A new release is expected soon. It's now possible to use the LaTeX math text syntax ( However, in
|
Fixed by sciapp/gr@f37dfaa. |
It would be great to achieve two goals when passing
xlabel
,title
, etc. kwargs:For example to set
$
asxaxis
you need to do with GR backendplot(1:10, xlabel="\$\$")
, but this is GR specific.x-ref #3991 for a specific case
x-ref #3122
Why does it start to matter currently. The reason is that with addition of metadata support to tables I (and maybe other people) start to generate things like
xlabel
,title
etc. programmatically (getting the required strings from metadata and this metadata is read-in along with the data to be displayed e.g. from a Parquet file) and then automatically generate e.g. a report. In such pipelines the string to be displayed does not even show up in the source code. The problem is that you need to be sure that what you try to display actually gets displayed.The text was updated successfully, but these errors were encountered: