## colorbar.gle
size 12 8
set font ss
include "barstyles.gle"
set lwidth 0.01
sub mypalette z
! Initialize r, g, b to the starting colour of the gradient.
! We are assuming ending colour is white (1,1,1).
local r = 94/360
local g = 19/360
local b = 175/360
return cvtrgb(z*(r-1)+1,z*(g-1)+1,z*(b-1)+1)
end sub
! Override built in bar_colormap
bar_colormap_pixels = 200 !What does this do?
sub bar_mycolormap x1 y1 x2 y2 b g
amove x1 y1
begin clip
begin path clip
box x2-x1 y2-y1
end path
colormap "y" 0 1 0 1 1 bar_colormap_pixels x2-x1 y2-y1 palette mypalette
end clip
end sub
begin graph
ytitle "Performance"
data "colorbar.dat"
xaxis min 0.5 max 4.5 dticks 1
yaxis min -5 max 85 dticks 10
xdsubticks off
x2axis off
y2axis off
yaxis grid
yticks color grey20
bar d1,d2 width 0.3,0.3 style mycolormap,mycolormap
end graph
## colorbar.dat
1 -2 7
2 10 9
3 50 45
4 70 80