johnyf / fig2u3d

Export MATLAB figure as U3D file or directly to 3D interactive PDF
http://www.mathworks.com/matlabcentral/fileexchange/37640-export-figure-to-3d-interactive-pdf
BSD 2-Clause "Simplified" License
63 stars 25 forks source link

No axis, to manually add axis draw lines on axis manually #18

Open prateekrajgautam opened 4 years ago

prateekrajgautam commented 4 years ago

or call this function Axis3d

function []=Axis3d(x,y,z)
if nargin==0
    g=gcf;
    a=g.CurrentAxes;
    xLim=a.XLim;
    yLim=a.YLim;
    zLim=[-1,1];
else
    x1=min(x)
    x2=max(x)
    y1=min(y)
    y2=max(y)
    z1=min(z)
    z2=max(z)
    xLim=[x1,x2];
    yLim=[y1,y2];
    zLim=[z1,z2];
end
hold on
plot3(xLim,[0, 0],[0, 0],'-k')
hold on
plot3([0, 0],yLim,[0, 0],'-k')
hold on
plot3([0, 0],[0, 0],zLim,'-k')