필터 지우기
필터 지우기

3d Plot Coordinate Axis Settings

조회 수: 61 (최근 30일)
형준 이
형준 이 2022년 9월 2일
편집: Cameron 2023년 11월 22일
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);

채택된 답변

Chaitanya Krishna Kantambhatla
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
형준 이
형준 이 2022년 9월 6일
Thanks for the detailed explanation.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Cameron
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'

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by