フィルターのクリア

How can I create a 3D graph with a color map in the range from 0 to 1 ?

27 ビュー (過去 30 日間)
Sam Kalho
Sam Kalho 2022 年 3 月 14 日
コメント済み: Star Strider 2022 年 3 月 14 日
Hello all,
I need your help to solve my problem.
The following code I created will create such a diagram.
here output_array is predicted deviation.
clear all;
clc;
xg = X_achse_of_geometrie + output_array;
yg = Y_achse_of_geometrie + output_array;
zg = Z_achse_of_geometrie + output_array;
axes7 = axes('Parent',figure);
plot3(xg, yg, zg , '.');
colorbar(axes7);
zlabel('Z [mm]');
ylabel('Y [mm]');
xlabel('X [mm]');
title('component');
view(axes7,[-37.5 30]);
grid(axes7,'on');
Do you have any idea how I can match the color of the color map to the plot?
I have added my data in the attachment.
I would be very grateful to you guys.
Thank you in advance.

採用された回答

Star Strider
Star Strider 2022 年 3 月 14 日
Another approach —
xg = X_achse_of_geometrie + output_array;
yg = Y_achse_of_geometrie + output_array;
zg = Z_achse_of_geometrie + output_array;
zg = rescale(zg, -0.01, 1.01);
figure
scatter3(xg, yg, zg, 5, zg, 'filled')
grid on
colormap(turbo)
colorbar
The rescale funciton was introduced in R2017b.
.
  2 件のコメント
Sam Kalho
Sam Kalho 2022 年 3 月 14 日
thanks a lot.
very helpful
Star Strider
Star Strider 2022 年 3 月 14 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by