scatter3 - 以某种方式显示x,y,z

时间:2012-11-27 14:21:02

标签: matlab plot octave

我想像这样显示x,y,z轴(连同散点图数据):

3D coord. system

我尝试使用GUI编辑图形(例如尝试移动y轴)。我有什么方法可以实现这个目标吗?

我的基本代码:

M = csvread('H:\Bla.csv', 1);

figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1,'YAxisLocation','right','XAxisLocation','top',...
    'MinorGridLineStyle','none',...
    'GridLineStyle','-');
view(axes1,[-65.5 36]);
grid(axes1,'on');
hold(axes1,'all');

% Create scatter3
scatter3(M(:,1),M(:,2),M(:,3));

% Create xlabel
xlabel('X');

% Create ylabel
ylabel('Y');

% Create zlabel
zlabel('Z');

1 个答案:

答案 0 :(得分:1)

您可以手动执行此类操作(您仍需要添加箭头):

x = line([0 100],[0,0],[0,0],'color','r');
y = line([0 0],[0,100],[0,0],'color','g');
z = line([0 0],[0,0],[0,100],'color','b']);

或使用一些可用的FEX贡献: