how to flip the direction of the axis?
1,222 次查看(过去 30 天)
显示 更早的评论
Dear all,
I want to change the x-axis direction from right to left but also keeping the values to be not affected (reversed/flipped). when I used the fooling command the mentioned problem is caused:
set(gca, 'XDir','reverse')
How can I solve that?
thanks
0 个评论
采纳的回答
madhan ravi
2018-10-28
xticklabels([1:10]) %an example
set ( gca, 'xdir', 'reverse' )
2 个评论
DGM
2024-2-11
编辑:DGM
2024-2-11
"incorrect"
While that's a valid point, please use comments and try to explain what you mean to readers instead of just sniping with unhelpful single-word comments.
set() and get() are case-insensitive:
xticklabels([1:10]) %an example
set ( gca, 'XDir', 'reverse' ) % set still works
% see also:
get(gca,'XDir') % the actual case of the property name
get(gca,'xdir') % lower case
get(gca,'xdIR') % goofy case
% case does matter if you directly use dot indexing on the axes object
hax = gca;
hax.XDir % there is an XDir property
hax.xdir % but there is no xdir property
As to what the nuances of OP's actual problem were, I can't know.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axes Appearance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!