Dual colormap settings in a single figure

1 view (last 30 days)
Elliot
Elliot on 11 Feb 2013
Im trying to construct a plot of results that uses a patch and a fill3 on the same figure (not subplots). The patch is a flat surface showing the finite volume grid im using whilst the fill3 is a 3D surface showing the solution over the grid.
Currently my patch plot is a single set colour whilst the fill3 surface is in jet. This is fine, however, for the purposes of presenting I need to show grid properties assigned to the finite volumes in my grid, so I would like to set these properties on the patch plot in greyscale.
This way I have a my finite volume mesh with corresponding property value shown on a flat patch3 plot with varying greyscale, whilst above it my solution is shown in a semi transparent jet colormapped fill3 plot.
Ive seen a couple of examples where i set the colormap to [gray(64);jet(64)]; and then i scale my CData values and slot them into the appropriate 'half' of the colormap but this has given me some issues. I can alter the patch plot where the colour data is set to the face with flat colouring but the fill3 plot is mapped onto vertices and has interpolated shading. I assume the interpolated shading shouldnt effect this but I get a warning saying not set for interpolate shading, fine i take it off but still doesnt work. I now get the following warning:
Warning: Patch FaceVertexCData length (126) must equal 1, Vertices length (3), or Faces length (1) for flat FaceColor
this makes no sense to me, but on looking into the handle returned by the fill3 plot i noticed that the handle was actually a vector of handles. I assume this is why i have this warning? If thats the case do I have to set the colormap for each handle in the vector? This makes even less sense because i only have one set of data, so to set the CData multiple times in a loop sounds daft.
Any help much appreciated
to set my CData to this dual colormap I am currently scaling my results into 64 bit to fit each colormap then offsetting the jet by 64 to bump the indexing into the jet side of the colormap
set(p,'CDataMapping','direct') set(p,'Cdata',Pscaled_values)
set(f,'CDataMapping','direct') set(f,'Cdata',Fscaled_values)
where p and f are my patch3 and fill3 handles respectively

Answers (0)

Categories

Find more on Colormaps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!