How to plot axis with origin (0,0,0) on 3D plot

조회 수: 16 (최근 30일)
Gregor Lees
Gregor Lees 2015년 11월 26일
댓글: Thorsten 2015년 11월 26일
I am using 3 matrices to form a 3D plot.
I am using the plot function >> line(S10,S20,S30, Axes=(0,0,0) 'linestyle', 'none', 'marker', '.', 'markeredgecolor', 'b', 'markersize', 0.1 ); view(3);
This is not the problem (I have tried using other plot functions and this is the only one that works).
However, on each of my axis I have positive and negative values but my axis are all positioned at the minimum value. How do i get the axis to be positioned at (0,0,0) with the above function?

답변 (1개)

Thorsten
Thorsten 2015년 11월 26일
편집: Thorsten 2015년 11월 26일
Since R2015b, you can use
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';
For older versions, have a look at this blog.
  댓글 수: 2
Gregor Lees
Gregor Lees 2015년 11월 26일
Sadly its version 2014b. Yeh I had seen that blog, unfortunately when I enter the following code,
>> line(S10,S20,S30, Axes = Origin, AxesOrigin = [0, 0, 0], 'linestyle', 'none', 'marker', '.', 'markeredgecolor', 'b', 'markersize', 0.1 ); view(3);
this error message appears,
line(S10,S20,S30, Axes = Origin, AxesOrigin = [0, 0, 0], 'linestyle', 'none', 'marker', '.', 'markeredgecolor', 'b', 'markersize', 0.1 );
Error: The expression to the left of the equals sign is not a valid target for an assignment.
(the highlighted part is the equals sign in "Axes = Origin")
Thorsten
Thorsten 2015년 11월 26일
Try the submission to the FileExchange PlotAxisAtOrigin

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

카테고리

Help CenterFile Exchange에서 Axes Appearance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by