control makesymbolspec and colorbar color assignment, e.g. linear vs. logarithmic
Mostrar comentarios más antiguos
Hi folks, My apologies if this is answered elsewhere, but I've searched all over. Briefly, I'm using the mapping toolbox to color polygons based on values in a shapefile . For some datasets (e.g., coloring US states by population), the way symbolspec groups the data is fine. But for others (i.e., things that some states do and others don't - e.g., growing cotton, or producing oil, etc.), a linear scale can't show the necessary details. In these cases, there are many states down at the bottom end of the scale, and just a few at the top.
Is there a way to 'shift' the colors to account for this - so that the colorbar is not dominated by a large value?
E.g.,if
data = [1 1.5 1.8 3 4.5 8 70 100]
I'd like values < 2 to be one color, the values > 2 and < 5 to be another, the values > 5 and < 10 another, etc. With these data, as I currently use makesymbolspec, I get all the low values ( i.e., less than 10) as one color. (Manually editing the colormap is possible (though tedious), but the colorbar would then be dominated by the color that stretches from, e.g., 10 - 100.)
Here's how I code the variable densityColors, to be used in geoshow:
densityColors = makesymbolspec('Polygon', ...
{'TmpData', [0 max(data)],...
'FaceColor', myColormap});
Thanks very much in advance!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!