From: Gary on 25 Feb 2010 20:03 I'm trying to display colored dots on a background map, where the color of each dot represents the temperature at that site. I then want to display a colorbar to the right of the map that shows the color-coded temperature scale shown by the dots. Problem is that the colorbar is linked the colormap used to display the background map (a grey-scale DEM in my case). My real question is how can I link the colorbar to the color mapping used for the dots, which are created using the patchm command? I've tried a bunch of things, none of which have worked. Any ideas??? -Gary Clow U.S. Geological Survey
From: ImageAnalyst on 25 Feb 2010 23:20 Gary: This is like how windows reserves colors. You can do a similar thing. You display your colored dots not in color but in monochrome. The key is that you have to reserve a portion of the palette for your special colors (just like Windows does). For example, you reserve gray levels 0-63 for your colors and remap your gray levels to 64-255. Then you have your colormap be pseudocolor in the bottom 64 gray levels , and gray in the upper gray levels. The trouble is this split color/gray colormap will show up in your color bar - it won't be just the colored part. Alternatively you can just display two axes, use a color image instead of a monochrome image, and use a second axes to essentially make your own color bar image. And you write your own colored dots in RGB into the RGB image.
|
Pages: 1 Prev: working with logicals Next: Root guess values for Newton's Raphon method |