-
Notifications
You must be signed in to change notification settings - Fork 40
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
Vector syntax not working within options? #284
Comments
It is possible Line 229 in 7b41de7
print_tex on the v s.
I just tried something like @eval PGFPlotsX begin
print_opt(io::IO, v::AbstractVector) = print(io, join((print_tex(String, x) for x in v), ","))
end and I get julia> node_options
[circle, pin={[pin edge={out={-70}, in={110}, semithick}, color={rgb,1:red,0.0052;green,0.0982;blue,0.3498}] ,below right:{my_text}
}] I haven't thought anything deep about this though. |
It's almost good, but it prints a comma behind the square brackets which tikz doesn't understand. I guess this is sort of special syntax though, as it's options for tikz and not for pgf. For the sake of completeness, here is something that actually shows a picture (and does work with the first
|
Note that this is TikZ code, not pgfplots. In the manual we suggest that I sympathize with
but I would recommend constructing the string from something like col = colorant"firebrick3"
sprint(PGFPlotsX.print_opt, col) which is currently not officially part of the API but should remain supported. Generally, quite a few building blocks of the package are useful outside pgfplots, and maybe we should make an effort to clean up and export them to emit LaTeX code for general purposes. |
Maybe we should just expose (but not necessarily export) |
Does the vector syntax not work within a set of options or am I just missing how to do this right?
This is what I would like to obtain:
But, within the options of
pin
I don't want to hardcode the color. So I can do:and so far,
print_tex(pin)
does what I want to get:However, using
pin
within another set of options prints Julia types insteadThe text was updated successfully, but these errors were encountered: