3d Plot Coordinate Axis Settings
조회 수: 59 (최근 30일)
이전 댓글 표시
I loaded the .stl file using the pdegplot (code name).
I want to erase the red arrow on the picture.
What should we do?
< my code >
H = pdegplot(GEO); grid on; axis equal; view(3);
xlabel('X(Range)'); ylabel('Y(X-Range / Azi.)'); zlabel('Z(X-Range / Ele.)');
set(HH2(1,1),'FaceColor',[0.8 0.5 0.3]);
xlim([-3 3]); ylim([-2.5 2.5]); zlim([0 3.5]);
xticks(-3:1:3); yticks(-2:1:2.5); zticks(0:1:3.5);
댓글 수: 0
채택된 답변
Chaitanya Krishna Kantambhatla
2022년 9월 5일
Consider the example pdegplot from the documentation.
model = createpde;
importGeometry(model,'BracketWithHole.stl');
pdegplot(model,'FaceLabels','on','FaceAlpha',0.5);
The result of the following command plots a 3D graph consists of the quiver you wish to remove.
b=findobj(gca,'Type','Quiver');
Now b contains the property of Quiver. You can use the set command to set ‘Visible’ property to ‘off’.
set(b,'Visible','off');
In order to remove the text ‘x’, ’y’, and ‘z’ from the plot, go to property inspector and uncheck the visibility of the text.
Property inspector can be opened from the view tab of the plot window.
Now the plot does not show the text ‘x’, ‘y’, and ‘z’.
추가 답변 (1개)
Cameron
2023년 11월 22일
편집: Cameron
2023년 11월 22일
Similar to Chaitanya Krishna Kantambhatla's earlier answer, but without having to use the Property inspepector, you can remove the Text label by this method (using MATLAB R2022b).
set(findall(gca,'Layer','Middle'),'Visible','Off')
Note:
@Chaitanya Krishna Kantambhatla I am still confused why the first item in the middleLayer behaives differently than the ladder two. After looking at the class properties of each item in the array, I see the first layer (the one that contains the "x", "y", and "z" text) is a different class than the other two; the axes labels are a 'matlab.graphics.primitive.world.Text'. An interesting result is when you query middleLayer(1) it will only display "Text", but without any of the visible properties. See below.
>> middleLayer = findall(gca,'Layer','Middle')
middleLayer =
3×1 graphics array:
Text
Text
Text
>> middleLayer(1)
ans =
Text
>> middleLayer(2)
ans =
Text with properties:
String: ''
FontSize: 11
FontWeight: 'bold'
FontName: 'Helvetica'
Color: [0 0 0]
HorizontalAlignment: 'center'
Position: [-1.5438 -1.5357 3.7878]
Units: 'data'
Show all properties
>> middleLayer(3)
ans =
Text with properties:
String: ''
FontSize: 11
FontWeight: 'normal'
FontName: 'Helvetica'
Color: [0 0 0]
HorizontalAlignment: 'center'
Position: [-1.5438 -1.5357 3.7878]
Units: 'data'
Show all properties
>> class(middleLayer(1))
ans =
'matlab.graphics.primitive.world.Text'
>> class(middleLayer(2))
ans =
'matlab.graphics.primitive.Text'
>> class(middleLayer(3))
ans =
'matlab.graphics.primitive.Text'
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!