Change x,y,z axes position in a 3d plot - subplot issue
显示 更早的评论
Hello. I would like to change the positions of the label of a 3d plot to the back of the graph. I am using the XRuler property as jonas suggested in previous question (https://it.mathworks.com/matlabcentral/answers/420731-moving-the-labels-of-the-z-axis-to-the-back-of-the-3d-graph). When I plot one graph everythng works fine, hoever when I try to make subplots, one big plot overwrites all the others (as in the figure attached).
Here is the code I am using:
params = struct;
params.supply = zeros(1,3,9); %3D matrix with the data to plot
params.supply(1,:,1) = [0.8 0.1 0.1];
params.supply(1,:,2) = [0.7 0.1 0.2];
params.supply(1,:,3) = [0.475 0.05 0.475];
params.supply(1,:,4) = [0.4 0.4 0.2];
params.supply(1,:,5) = [0.3 0.3 0.4];
params.supply(1,:,6) = [0.2 0.2 0.6];
params.supply(1,:,7) = [0.1 0.8 0.1];
params.supply(1,:,8) = [0.1 0.7 0.2];
params.supply(1,:,9) = [0.05 0.475 0.475];
figure(1);hold on
for deme= 1:9
subplot(3,3,deme)
hAxis = axes;
scatter3(params.supply(1,1,deme), params.supply(1,2,deme), params.supply(1,3,deme),'d')
hAxis.XAxis.FirstCrossoverValue = hAxis.XLim(2);
hAxis.XAxis.SecondCrossoverValue = hAxis.XLim(1);
hAxis.YAxis.FirstCrossoverValue = hAxis.XLim(2);
hAxis.YAxis.SecondCrossoverValue = hAxis.XLim(1);
hAxis.ZAxis.FirstCrossoverValue = hAxis.XLim(2);
hAxis.ZAxis.SecondCrossoverValue = hAxis.XLim(2);
hAxis.XLim = [0 1];
hAxis.YLim = [0 1];
hAxis.ZLim =[0 1];
end
hold off

I feel like I am doing a stupid error somewhere, but can't seem to find it. Any ideas ?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!