Apply colormap of one surface to another

3 ビュー (過去 30 日間)
Russell Lubin
Russell Lubin 2022 年 1 月 28 日
回答済み: Voss 2022 年 1 月 28 日
Hello! I have made some graphs and I want to be able to analyze the relationship between each other. As far as I can tell, the surfaces generate their coloring based on the value of the data that they plot. I would like to take the coloring (i.e z-value) and map it onto a different graph.
I am trying to minimize the actuation tube force while maximimizing flap force, and I would like to apply the colormapping of the flap graph to the actuation tube graph.
I figured if I can "see" the value of the flap force (i.e the colorscale) and then match that up with the height of the tube force that I can see by nature of the 3D surface then I can find a reasonable approximation for an optomized system. Additionally, this will be a very useful graphic for my report.
If you know how to do this, please let me know. Thank you!

回答 (1 件)

Voss
Voss 2022 年 1 月 28 日
You can specify the color of a surface separately from the z-values, using the fourth input argument C.
First, the default: coloring according to Z:
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
figure();
surf(X,Y,Z);
colorbar();
Second, specify the colors explicitly instead:
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
C = X.*Y;
figure();
surf(X,Y,Z,C);
colorbar();
So perhaps you can specify the colors of your second surface to be the z-values of your first surface.

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by