フィルターのクリア

Moving axis to origin in an isosurface plot

5 ビュー (過去 30 日間)
Jon Kragskow
Jon Kragskow 2018 年 6 月 17 日
コメント済み: Jon Kragskow 2018 年 6 月 19 日
Hi,
Im trying to move the axes of my isosurface plot so that they all intersect at the origin of the coordinate system.
I've tried using
ax = gca
ax.XAxisLocation = 'origin'
ax.YAxisLocation = 'origin'
but this does nothing.
Are these even the right commands to use?
I've attached an image of my plot, i'll upload an MWE if necessary.
Thanks!

採用された回答

Sayyed Ahmad
Sayyed Ahmad 2018 年 6 月 18 日
編集済み: Sayyed Ahmad 2018 年 6 月 18 日
What you try would be worked in 2D.
plot(-1:0.1:1,(-1:0.1:1).^2)
axis equal
xlabel('x');ylabel('y');
ax=gca
ax.YAxisLocation
pause(3)
ax.YAxisLocation='origin'
pause(3)
ax.YAxisLocation='right'
hold on
pause(3)
view(150,30)
Maybe the following code is what you want:
[xSphere,ySphere,zSphere] = sphere(16); %# Points on a sphere
hAX=scatter3(xSphere(:),ySphere(:),zSphere(:),'.'); %# Plot the points
hold on; %# Add to the plot
xlabel('x');
ylabel('y');
zlabel('z');
axis off
plot([0 0],[-2 2],'r-.')
plot([-2 2],[0 0],'r-.')
plot3([0 0],[0 0],[-2 2],'r-.')
or
axis on
box on
grid on
  1 件のコメント
Jon Kragskow
Jon Kragskow 2018 年 6 月 19 日
Brilliant cheers, inserting the line plots is all I need!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScalar Volume Data についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by