Effacer les filtres
Effacer les filtres

change colormap in contourcmap to individual colormap

2 vues (au cours des 30 derniers jours)
Irina
Irina le 25 Juil 2011
When using contourcmap a string defines the colormap. But how can I access my own colormap?

Réponses (2)

Walter Roberson
Walter Roberson le 25 Juil 2011
I do not have the mapping toolbox to test this with, so I can only suggest a possible workaround:
If you create a function (in its own .m file) that accepts an optional parameter (which you can ignore), and the function returns the colormap you want, then try giving the quoted name of that function in place of the regular colormap string name.
The optional parameter for the function will be (if it is present) the number of entries desired for the colormap. 'jet' and so on do not return static information: they calculate the colormap suitable for the number of entries requested (default 256)
function cmap = MyColorMap(varargin)
cmap = [.......]; %the Nx3 colormap you want to return
end

Raul
Raul le 26 Août 2012
I had the same problem and this solution worked. Thanks.

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by