Custom color gradient map in Julia

I am currently using the Plots package and have it with the installed PyPlot packages. With code

using Plots
y = rand(10, 10)
pyplot()
plt = plot(y, st=:heatmap, clim=(0,1), color=:coolwarm, colorbar_title="y")

I can produce this heat map

My question is how to change the color gradient from its current setting (coolwarm, which corresponds to the transition from red to gray to blue) to the new setting with a gradient from red to green to blue. Is there a way to create my own color gradient and use it as an argument where I have "coolwarm" in my code sample?

+4
source share
1 answer

. , . clibraries(), , , cgradients(:colorbrewer) showlibrary(colorbrewer). , , . cgrad([:red, :green, :blue]) color.

+4

Source: https://habr.com/ru/post/1677935/


All Articles