KristofferC / PGFPlotsX.jl

Plots in Julia using the PGFPlots LaTeX package
Other
301 stars 40 forks source link

keys from expressions in pgf macro #293

Open tpapp opened 2 years ago

tpapp commented 2 years ago

When constructing options it would occasionally be useful to define not only values, but also keys with expressions. Currently the only way to do this that I am aware of is

let o = @pgf{}
    push!(o, v => nothing)
    o
end

A possible syntax could be $ interpolation, as in

line_styles = [:solid, :dashed, :dotted]
[@pgf({ $l }) for l in line_styles] # hypothetical feature and syntax