Greetings,
I am using surfc(x,y,z,colr) to plot a 3D surface with good success.
I am having problems controlling the color of the plotted surface.
I do not want a multi-color plot.
I want a single rgb color for the surface.
What values do I have tp put into 'colr' matrix of surfc(x,y,z,colr) to get a single colored surface.
Do I also need to use a colormap statement like 'colormap hsv;' or 'colormap bone' if I want a single rgb colored surface.
How to control the colors of the countour lines?
Thanks
Tricia
|
|
0
|
|
|
|
Reply
|
Tricia
|
12/11/2010 9:00:20 PM |
|
On 11/12/10 3:00 PM, Tricia wrote:
> I am using surfc(x,y,z,colr) to plot a 3D surface with good success.
> I am having problems controlling the color of the plotted surface.
> I do not want a multi-color plot.
> I want a single rgb color for the surface.
> What values do I have tp put into 'colr' matrix of surfc(x,y,z,colr) to
> get a single colored surface.
colr = 1;
would probably get you the surface colored by the last color in the
colormap.
If you want to specify the exact index of the colormap, do so in colr
and pass 'CDataMapping', 'direct' as the last arguments to surfc()
> Do I also need to use a colormap statement like 'colormap hsv;' or
> 'colormap bone' if I want a single rgb colored surface.
Only if you want to control the color you get.
colormap([R G B])
for some particular R G B values (0 to 1 range) would work in
combination with colr = 1 and leaving CDataMapping as the default.
> How to control the colors of the countour lines?
save the output of surfc() to a variable. The first entry of that array
will be the handle to the surface itself. All remaining entries in the
array will be the handle to a patch() object that draws one distinct
contour line (not contour level!). Those patches will all have their
zdata deliberately set to the lower value of the zlim so that the
contour lines appear "below" the surface; because of this, you cannot
simply read the zdata out of each patch to determine the z level it
corresponds to. The good news is that in each patch, the 'Userdata'
field has been set to the contour level. You would set() the 'EdgeColor'
property of the patch to reflect the color you want to appear for that
level.
|
|
0
|
|
|
|
Reply
|
Walter
|
12/12/2010 3:59:01 AM
|
|
Walter Roberson <roberson@hushmail.com> wrote in message <9MXMo.4257$Zf2.2868@newsfe17.iad>...
> On 11/12/10 3:00 PM, Tricia wrote:
>
> > I am using surfc(x,y,z,colr) to plot a 3D surface with good success.
> > I am having problems controlling the color of the plotted surface.
> > I do not want a multi-color plot.
> > I want a single rgb color for the surface.
> > What values do I have tp put into 'colr' matrix of surfc(x,y,z,colr) to
> > get a single colored surface.
>
> colr = 1;
>
> would probably get you the surface colored by the last color in the
> colormap.
>
> If you want to specify the exact index of the colormap, do so in colr
> and pass 'CDataMapping', 'direct' as the last arguments to surfc()
>
> > Do I also need to use a colormap statement like 'colormap hsv;' or
> > 'colormap bone' if I want a single rgb colored surface.
>
> Only if you want to control the color you get.
>
> colormap([R G B])
>
> for some particular R G B values (0 to 1 range) would work in
> combination with colr = 1 and leaving CDataMapping as the default.
>
> > How to control the colors of the countour lines?
>
> save the output of surfc() to a variable. The first entry of that array
> will be the handle to the surface itself. All remaining entries in the
> array will be the handle to a patch() object that draws one distinct
> contour line (not contour level!). Those patches will all have their
> zdata deliberately set to the lower value of the zlim so that the
> contour lines appear "below" the surface; because of this, you cannot
> simply read the zdata out of each patch to determine the z level it
> corresponds to. The good news is that in each patch, the 'Userdata'
> field has been set to the contour level. You would set() the 'EdgeColor'
> property of the patch to reflect the color you want to appear for that
> level.
Walter,
Thank you very much.
Using your suggested methods I have been able to obtain full color control of the surface and contour lines.
Thanks again
Tricia
|
|
0
|
|
|
|
Reply
|
Tricia
|
12/12/2010 2:50:21 PM
|
|
|
2 Replies
363 Views
(page loaded in 0.069 seconds)
Similiar Articles: Color Surface Plot - comp.soft-sys.matlabGreetings, I am using surfc(x,y,z,colr) to plot a 3D surface with good success. I am having problems controlling the color of the plotted surface. ... Mesh with different color at x=0 and y=0 - comp.graphics.apps ...Color Surface Plot - comp.soft-sys.matlab Mesh with different color at x=0 and y=0 - comp.graphics.apps ... Plot the edges of a surface - comp.soft-sys.matlab Color ... Overlaying surface plot on an image - comp.soft-sys.matlab ...I managed to overcome this issue creating a new axes to place the surface plot and setting the axes 'color' to 'none', which worked out nicely on the figure displayed in ... 3d scatter plot of a color image? - comp.soft-sys.matlab ...Color Surface Plot - comp.soft-sys.matlab 3d scatter plot of a color image? - comp.soft-sys.matlab ... Color Tables; Subwindows; 3D and Volume. Surface Plots ... 3D ... plotting a 3D data in plane by color - comp.soft-sys.matlab ...Cut a plane through 3D surface - comp.soft-sys.matlab plotting a 3D data in plane by color - comp.soft-sys.matlab ... Color Surface Plot - comp.soft-sys.matlab Cut a plane ... surfc with contourf - comp.soft-sys.matlabSetting z scale in mesh plots - comp.soft-sys.matlab Color Surface Plot - comp.soft-sys.matlab Greetings, I am using surfc(x,y,z,colr) to ... Set icon for GUI figure ... histogram error bar color - comp.graphics.apps.gnuplotThey get the same color as the border of the fill style. So set style fill ... Bar plot color/shading issues - comp.soft-sys.matlab Histogram with gplot - comp.soft ... Plot xyz surface data from matrix or file - comp.soft-sys.matlab ...Converting XYZ Data to a Matrix - Create Surface plots and Contour ... The bottom image shows a 3D Color Map Surface (Mesh) plot of the resultant matrix data with the ... changing colors in bar3 plot - comp.soft-sys.matlabHi, With Matlab R12.1 (BAR3 returns SURFACE objects) : Y = cool(7); bar3 ... How do I change the color in each bar of a plot in MATLAB? Date Last Modified: Friday ... Setting color scale in mesh plots - comp.soft-sys.matlab ...• Surface and Mesh Creation • Domain ... colorbar -Colorbar showing color scale Alternatives. Add a colorbar to a plot with the ... description of the properties you can ... 3-D shaded surface plot - MATLAB - MathWorks - MATLAB and Simulink ...Z specifies the color data, as well as surface height, so color is proportional to surface height. surf(Z,C) plots the height of Z, a single-valued function defined over a ... Coloring Mesh and Surface Plots :: Creating 3-D Graphs (MATLAB®)Coloring Techniques. You can enhance the information content of surface plots by controlling the way MATLAB graphics apply color to these plots. 7/24/2012 10:56:03 PM
|