planarColorKey encode two scalar properties as hue × saturation colors
* Property 1 → Hue (sampled from a user-supplied or default LUT)
* Property 2 → Saturation (linearly from 0 or 1 to full color)Syntax
cK = planarColorKey
cK = planarColorKey(winter, 'colorModel', 'white', ...)rgb = cK.property2color(v1, v2)plot(cK) % standalone legend (key image only, no labels)
plot(cK, 'labeled') % legend with labels according to data rangeProperties colorMap - n-by-3 hue look-up table. colorModel - 'white' (default) | 'black' what zero-saturation maps to periode - frequency of periodic data (pi/2*pi), wrapping v1. Default: NaN quantileCap - quantile for maximum of v2. Default: 0.975 range1 - data range of v1. Default: [min(v1), max(v1)] range2 - data range of v2. Default: [min(v2), quantile(v2,0.975)] label1 - x-axis label in plot(). Default: 'Property 1' label2 - y-axis label in plot(). Default: 'Property 2'
Example
Example 1: long axis mapping, with saturation given by aspect ratio get the data
mtexdata martensite silent
grains = ebsd('indexed').calcGrains('minPixel',5);
asr = grains('indexed').aspectRatio;
lax = grains('indexed').longAxis;set up colormap
pK = planarColorKey(colorcet('C2'));
% since long axis direction is periodic and antipodal (=pi)
pK.periode = pi;
pK.label1 = 'phi';
pK.label2 = 'a/b';
% and plot it
plot(pK,mod(lax.rho,pi)/degree,asr)
use the key to colorize the map
plot(grains('indexed'),pK.property2color(mod(lax.rho,pi)/degree,asr))
example 2: highlight grains which are large AND have a large aspect ratio
v1 = grains('indexed').aspectRatio;
v2 = grains('indexed').area;set a colormap
pK = planarColorKey(inferno);shade to black
pK.shading = 'black';set the range1 for v1
pK.range1 = [1 4];set the autoselection of v2 a little lower
pK.quantileCap = 0.9;set labels
pK.label1 = 'asr'; pK.label2 = 'area';
close all; plot(pK,v1,v2)
plot(grains('indexed'),pK.property2color(v1,v2))
See also
Citing this page.
This page is part of the documentation of
MTEX, a free and open
source MATLAB toolbox for analyzing and modeling crystallographic textures.
It was written by The MTEX Developers and is published at
https://mtex-toolbox.github.io/planarColorKey.html.
If you use MTEX, or reuse text or figures from this page, in your research,
please cite
F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63
BibTeX
@article{bachmann2010mtex,
author = {F. Bachmann and R. Hielscher and H. Schaeben},
title = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
journal = {Solid State Phenomena},
volume = {160},
pages = {63-68},
year = {2010},
doi = {10.4028/www.scientific.net/SSP.160.63},
url = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}
Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.