Apply a specific RGB color on plot3

12 ビュー (過去 30 日間)
Alberto Acri
Alberto Acri 2023 年 5 月 14 日
回答済み: Walter Roberson 2023 年 5 月 14 日
Hi. I have this code.
selection = importdata("selection.mat");
figure
plot3(selection(:,1),selection(:,2),selection(:,3),'b.','Markersize',5)
grid on
hold on
axis equal
xlabel('x')
ylabel('y')
zlabel('z')
I would like to apply a certain color (in this example, blue) to the nodes using an RGB value, for example like this:
plot3(selection(:,1),selection(:,2),selection(:,3),'Color',[0,0,1],'Markersize',5)
  2 件のコメント
Walter Roberson
Walter Roberson 2023 年 5 月 14 日
plot3(selection(:,1),selection(:,2),selection(:,3),'.','Color',[0,0,1],'Markersize',5)
Alberto Acri
Alberto Acri 2023 年 5 月 14 日
ok, thanks!

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

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 5 月 14 日
plot3(selection(:,1),selection(:,2),selection(:,3),'.','MarkerFaceColor',[0,0,1],'Markersize',5)
There is also MarkerEdgeColor. For the '.' marker, whether you use Face or Edge seems to affect the shade of blue used, and I am not sure why that is. For some styles of markers it is important which one you use; 'Face' color corresponds to asking for 'fill' on the markers, but some markers are only defined in terms of edge.

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by