Open asinghvi17 opened 5 years ago
You can use Colors colormap (https://kristofferc.github.io/PGFPlotsX.jl/stable/examples/juliatypes/#Colormap-1) so adding for ColorGradient
shouldn't be hard.
From Slack, this seems like the place to start - https://github.com/KristofferC/PGFPlotsX.jl/blob/master/src/requires.jl . I will link the PR when it's up, thanks!
There is an implementation for this in Plots.jl
function pgfx_colormap(grad::ColorGradient)
join(map(grad.colors) do c
@sprintf("rgb=(%.8f,%.8f,%.8f)", red(c), green(c), blue(c))
end,"\n")
end
It would be really nice if there was support for JuliaPlots/PlotUtils.jl colormaps in PGFPlotsX.
PlotUtils uses the
ColorGradient
construct, which is essentially anArray{RGBA{N0f8}, 1}
with some lengthn
. I don't have too much experience with translation of colormaps to PGFplots but the manual doesn't make it seem too hard.