[Sea-mat] multiple colormap/colorbars?
Carlos Moffat
cmoffat at whoi.edu
Wed Sep 15 09:52:59 EDT 2004
Ooops.
Make step 2)
h=findobj('tag','TMW_COLORBAR')
Cheers,
Carlos
Carlos Moffat wrote:
> Hi Lynn,
>
> I'm afraid I only have a partial solution for you, but it might take you
> in the right direction:
>
> Say you have a contour plot/subplot and you've done
>
> 1a) H=colorbar (you'll have to have a different handle for each subplot)
>
> Then you do
>
> 1b) h=get(H,'children')
>
> or alternatively (in matlab 7)
>
> 2) h=findobj('tag','TMW_colorbar') this would give you the same result
> as 1.
>
> 3) once you have access to h, you can change the limits of your colorbar
> by playing with the 'cdata' property. If you used the default length
> colormap, that would be 64x1 (make sure to use a nx1 vector, not 1xn)
> series of numbers. If you change that to, say:
>
> set(h,'Cdata',1:34)
>
> you've done what you want.
>
> Although! it is only a partial solution in that you still have to figure
> out how to translate your real units to "cdata" units, but should be too
> much of a problem.
>
> Cheers,
> Carlos
>
> Lynn Yarmey wrote:
>
> >
> > hello everyone,
> >
> > i am hoping someone can help me with the following:
> >
> > i am using different colormaps for different subplots in a figure.
> since
> > the colormap is attached to the figure properties as opposed to the axis
> > properties, the colormaps are concatenated and i am pulling out the
> colors
> > for each subplot from the larger colormap with 'CLim'.
> >
> > however, when i add the colorbars to each subplot, the bar shows the
> > entire range of the concatenated colormap. i have tried changing the
> > 'YLim' properties of the axis, but this changes the Y axis of my plot
> > rather than of the colorbar. is there a way to call out the axis
> of the
> > colorbar itself, or a better way to get the colorbar to only display the
> > colors associated with that map?
> >
> > any help is appreciated!
> > lynn
> >
> >
> > ___________________________________________________________
> > Lynn Yarmey
> > Integrative Oceanography Division - 0209
> > Scripps Institution of Oceanography
> > University of California, San Diego
> > 9500 Gilman Dr. La Jolla, CA 92093
> >
> > _______________________________________________
> > Sea-mat maillist - Sea-mat at whoi.edu
> > http://mailman.whoi.edu/mailman/listinfo/sea-mat
> >
>
--
--
---------------------------------------
Carlos Moffat
MIT/WHOI Joint Program in Oceanography
MS #21
Woods Hole Oceanographic Institution
360 Woods Hole Road
Woods Hole, MA 02543
Phone: (508) 289-3589
Fax: (508) 457-2181
--------------------------------------
More information about the Sea-mat
mailing list