PosePlot - Y and Z Axes cannot be reversed

When using the poseplot() tool in Matlab 2023a. Only the X axis can be manipualted. The Y and Z axes cannot be changed. Wondering if this is a bug or if there is another mechanism to reverse the axes.
%% Example Code
% Convert euler angles to quaternion
q = quaternion([30,45,60],'eulerd','XYZ','point')
% Create a poseplot
poseplot(q)
% Try and reverse the axes
set(gca,'ZDir','Reverse')
set(gca,'YDir','Reverse')
set(gca,'XDir','Reverse') % Only X works

 Accepted Answer

hello
well , your Y and Z directions are already 'reverse' in first place, while Xdir was 'normal'
so if you wanted to change all 3 directions you needed to do
set(gca,'XDir','Reverse')
set(gca,'YDir','normal')
set(gca,'ZDir','normal')
%% Example Code
% Convert euler angles to quaternion
q = quaternion([30,45,60],'eulerd','XYZ','point')
q = quaternion
0.82236 + 0.02226i + 0.43968j + 0.36042k
% Create a poseplot
poseplot(q)
get(gca)
ALim: [0 1] ALimMode: 'auto' AlphaScale: 'linear' Alphamap: [0 0.0159 0.0317 0.0476 0.0635 0.0794 0.0952 0.1111 0.1270 0.1429 0.1587 0.1746 0.1905 0.2063 0.2222 0.2381 0.2540 0.2698 0.2857 0.3016 0.3175 0.3333 … ] (1×64 double) AmbientLightColor: [1 1 1] BeingDeleted: off Box: off BoxStyle: 'back' BusyAction: 'queue' ButtonDownFcn: '' CLim: [0 1] CLimMode: 'auto' CameraPosition: [-18.2628 23.8006 -17.3205] CameraPositionMode: 'auto' CameraTarget: [0 0 0] CameraTargetMode: 'auto' CameraUpVector: [0 0 -1] CameraUpVectorMode: 'auto' CameraViewAngle: 10.3396 CameraViewAngleMode: 'auto' Children: [1×1 PosePatch] Clipping: on ClippingStyle: '3dbox' Color: [1 1 1] ColorOrder: [7×3 double] ColorOrderIndex: 2 ColorScale: 'linear' Colormap: [256×3 double] ContextMenu: [0×0 GraphicsPlaceholder] CreateFcn: '' CurrentPoint: [2×3 double] DataAspectRatio: [1 1 1] DataAspectRatioMode: 'manual' DeleteFcn: '' FontAngle: 'normal' FontName: 'Helvetica' FontSize: 10 FontSizeMode: 'auto' FontSmoothing: on FontUnits: 'points' FontWeight: 'normal' GridAlpha: 0.1500 GridAlphaMode: 'auto' GridColor: [0.1500 0.1500 0.1500] GridColorMode: 'auto' GridLineStyle: '-' GridLineWidth: 0.5000 GridLineWidthMode: 'auto' HandleVisibility: 'on' HitTest: on InnerPosition: [0.1300 0.1100 0.7750 0.8150] InteractionOptions: [1×1 matlab.graphics.interaction.interactionoptions.InteractionOptions] Interactions: [1×1 matlab.graphics.interaction.interface.DefaultAxesInteractionSet] Interruptible: on LabelFontSizeMultiplier: 1.1000 Layer: 'bottom' Layout: [0×0 matlab.ui.layout.LayoutOptions] Legend: [0×0 GraphicsPlaceholder] LineStyleCyclingMethod: 'aftercolor' LineStyleOrder: '-' LineStyleOrderIndex: 1 LineWidth: 0.5000 MinorGridAlpha: 0.2500 MinorGridAlphaMode: 'auto' MinorGridColor: [0.1000 0.1000 0.1000] MinorGridColorMode: 'auto' MinorGridLineStyle: ':' MinorGridLineWidth: 0.5000 MinorGridLineWidthMode: 'auto' NextPlot: 'replace' NextSeriesIndex: 2 OuterPosition: [0 0 1 1] Parent: [1×1 Figure] PickableParts: 'visible' PlotBoxAspectRatio: [1 1 1] PlotBoxAspectRatioMode: 'auto' Position: [0.1300 0.1100 0.7750 0.8150] PositionConstraint: 'outerposition' Projection: 'orthographic' Selected: off SelectionHighlight: on SortMethod: 'depth' Subtitle: [1×1 Text] SubtitleFontWeight: 'normal' Tag: '' TickDir: 'out' TickDirMode: 'auto' TickLabelInterpreter: 'tex' TickLength: [0.0100 0.0250] TightInset: [0 0.0523 0 0] Title: [1×1 Text] TitleFontSizeMultiplier: 1.1000 TitleFontWeight: 'bold' TitleHorizontalAlignment: 'center' Toolbar: [1×1 AxesToolbar] Type: 'axes' Units: 'normalized' UserData: [] View: [-37.5000 30] Visible: on XAxis: [1×1 NumericRuler] XAxisLocation: 'bottom' XColor: [0.1500 0.1500 0.1500] XColorMode: 'auto' XDir: 'normal' XGrid: on XLabel: [1×1 Text] XLim: [-2 2] XLimMode: 'auto' XLimitMethod: 'tight' XMinorGrid: on XMinorTick: off XScale: 'linear' XTick: [-2 0 2] XTickLabel: {3×1 cell} XTickLabelMode: 'auto' XTickLabelRotation: 0 XTickLabelRotationMode: 'auto' XTickMode: 'auto' YAxis: [1×1 NumericRuler] YAxisLocation: 'left' YColor: [0.1500 0.1500 0.1500] YColorMode: 'auto' YDir: 'reverse' YGrid: on YLabel: [1×1 Text] YLim: [-2 2] YLimMode: 'auto' YLimitMethod: 'tight' YMinorGrid: on YMinorTick: off YScale: 'linear' YTick: [-2 -1 0 1 2] YTickLabel: {5×1 cell} YTickLabelMode: 'auto' YTickLabelRotation: 0 YTickLabelRotationMode: 'auto' YTickMode: 'auto' ZAxis: [1×1 NumericRuler] ZColor: [0.1500 0.1500 0.1500] ZColorMode: 'auto' ZDir: 'reverse' ZGrid: on ZLabel: [1×1 Text] ZLim: [-2 2] ZLimMode: 'auto' ZLimitMethod: 'tight' ZMinorGrid: on ZMinorTick: off ZScale: 'linear' ZTick: [-2 -1 0 1 2] ZTickLabel: {5×1 cell} ZTickLabelMode: 'auto' ZTickLabelRotation: 0 ZTickLabelRotationMode: 'auto' ZTickMode: 'auto'
% Try and reverse the axes
set(gca,'XDir','Reverse') % Only X works
set(gca,'YDir','normal') % Y works too
set(gca,'ZDir','normal') % Z works too

1 Comment

Ah amazing, I hadn't realised that:
set(gca,'YDir','Reverse')
actually set the position to "reverse" I thought it just flipped the axis.
Plot is working great now.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2023a

Asked:

on 10 Oct 2023

Commented:

on 10 Oct 2023

Community Treasure Hunt

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

Start Hunting!