2
votes

I'm constructing a graph plot in Julia and need to color each edge of the graph differently, based on some weighting factor. I can't find a way to get a specific RGB (or HSV, it doesn't matter) value from a colormap. Let's say I'd like to get the RGB value on 'jet' that would correspond to a data value of n on imshow plot.

In python, I would just use jet(n), where n is the value along the colormap in which I am interested. PyPlot in Julia doesn't seem to have wrapped this functionality. I've also already tried indexing into the cmap object returned from get_cmap(). Any advice?

I'm stumped, so even an approximate solution would help. Thanks!

1

1 Answers

1
votes

Maybe you can look at the Colors.jl package (https://github.com/JuliaGraphics/Colors.jl):

using Colors
palette = colormap("Oranges", 100)

Then you can access each color with palette[n]. Or are you using PyCall? A code describing what you're trying to do would help.