3d Plot Coordinate Axis Settings

71 views (last 30 days)
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);

Accepted Answer

Chaitanya Krishna Kantambhatla
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’.

More Answers (1)

Cameron
Cameron on 22 Nov 2023
Edited: Cameron on 22 Nov 2023
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'

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!