Reputation: 9149
I would like to display some data in Matlab using plot3
. This data makes the most sense in the left handed coordinate system.
However, MATLAB's 3D plot coordinate system is oriented with Z up which is inconsistent with the way the data is recorded - making visualization confusing. I understand that Matlab is also using a left handed coordinate system, except that it's rotated 90deg clockwise about the x-axis.
I've tried using the camup
command which gets kind of close to what I want, but as soon as the plot is rotated in the GUI, the camup
is thrown away and the plot reverts back to the above convention.
I would prefer not to rotate my data 90deg clockwise about the x-axis because it will introduce another level of ambiguity when it comes time for analysis and debugging.
EDIT: I think this sequence of instructions gets close.
set(gca, 'YDir', 'reverse');
camup([0 1 0]);
xlabel('X (mm)');
ylabel('Y (mm)');
zlabel('Z (mm)');
Upvotes: 3
Views: 1460
Reputation: 1362
You can plot a left handed coordinate system by reversing the direction of any one of the axes. This is controlled by the XDir
, YDir
, or ZDir
properties of the axes
.
surf(peaks)
set(gca, 'ZDir', 'reverse')
xlabel('x')
ylabel('y')
zlabel('z')
Upvotes: 5