在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Matlab图形调色
Simple examplevar colormap =
options =
colormap: 'jet'
nshades: 72
format: 'hex'
alpha: 1 // set an alpha value or a linear alpha mapping [start, end]
}
cg =
where leaving OptionsThe colormap can be any of the supported builtin colormaps. Or you can add your own. For an example of how to add your own see the json format available at: colorscales =
Colorscales are a sequence of objects containing an Return valuesAn array of hex values ('hex') or an array of length 4 arrays containing rgba values ('rgb') or an rgba css string ('rgbaString'). Complete ExampleThis example will produce the colormap image used at top of this README. It uses all built in color maps and utilizes alpha channel mapping. var cmap =
canvas = document
img = document
c = canvas
n = 48
colormaps =
'jet'
'copper'
'rainbow'
img
/*
* Build up the color ranges and add text
*/
for
c
c
c
c
c
}
var height
c
c
for
height = i*40;
colormap =
/*
* Now lets try some alpha maps overtop an image!
*/
var ilast = i;
c
// remove background img
img
for
height =
colormap =
}
Then just browserify it and throw it in some html and it will output the image above! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论