This works great and straight forward. I now saved the GR color gradient to a file and can load them with JLD. Not having to load GR and Plots in the same global scope makes my plotting much more readable. Now one more issue: How can I reverse the ColorGradient?
In Plots.jl, the ColorGradients can be revsersed with appending _r.
I figured this is done internally by the cgrad_reverse function in PlotUtilscolor_gradients.jl
How could I call this function?
First of: the ColorSchemes.bone.colors is not the color scheme I am looking for. To me it just doesn’t appear as nice.
I still struggle a bit in understanding ColorGradients.
I did not manage to reverse a ColorGradient as such. eachrow can not iterate through it.
My solution is now once:
using PlotUtils
using FileIO
using GR
GR.setcolormap(15)
cmap15 = cgrad([RGB(r...) for r=eachrow(GR.colormap())])
cmap15_r = cgrad([RGB(r...) for r=eachrow(GR.colormap()[end:-1:1,:])])
save(File(format"JLD","/home/joengel/lib/julia/utils/cmaps.jld"),"cmap15",cmap15,"cmap15_r",cmap15_r)
And for plotting
using FileIO
cmap15 = load("~/lib/julia/utils/cmaps.jld")["cmap15"]
cmap15_r = load("~/lib/julia/utils/cmaps.jld")["cmap15_r"]