Axis labels in root locus
43 次查看(过去 30 天)
显示 更早的评论
When I plot root locus, both axis labels contain units in brackets; what I get is the following: x axis: Real Axis (seconds-1) y axis: Imaginary Axis (seconds-1)
I'd like to have, instead, only the notation "Real Axis" respectively "Imaginary Axis". How can I remove "(seconds-1)"?
0 个评论
采纳的回答
Aniruddha Katre
2014-8-20
The plot generated by "rlocus" has two sets of axes, one hidden and one visible. The labels that you see are linked to the hidden axes. Therefore, when you use "xlabel" or "ylabel", the changes aren't implemented completely and you can still see the "seconds^-1" in the labels. In order to rename the labels according to your liking, you can use the following set of commands.
axIm = findall(gcf,'String','Imaginary Axis (seconds^{-1})');
axRe = findall(gcf,'String','Real Axis (seconds^{-1})');
set(axIm,'String','Imaginary Axis');
set(axRe,'String','Real Axis');
The call to the "findall" command finds the exact handle of the axes labels that you want to change by searching for the "String" property that is set to the current axes labels. If you want to change the axes labels to some other string, you can then execute the "set" command.
更多回答(1 个)
William Frane
2014-8-20
编辑:William Frane
2014-8-20
If you haven't already, try the xlabel() and ylabel() functions (they work for me).
For example:
h = tf([1 2 3],[4 5 6]);
rlocus(h);
xlabel('New x-axis label');
EDIT: This only works when using older versions of MATLAB (I initially tested it on R2008a). On newer versions (e.g., R2011b), xlabel() and ylabel() won't work and Aniruddha's solution must be used.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classical Control Design 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!