フィルターのクリア

Change LineWidth / LineStyle of stepplot() / bodeplot()

83 ビュー (過去 30 日間)
TS
TS 2017 年 11 月 11 日
コメント済み: Star Strider 2017 年 11 月 12 日
How can I change the LineWidth / LineStyle properties of a stepplot() Figure? From the Example :
sys = tf(4,[1 0.5 4]);
h = bodeplot(sys);
So how does one change Linewidth of this bode plot? I can add LineStyle properties when using h=bodeplot(sys,'--) e.g., yet if I acces the properties of bodeplot like discribed in the doc:
p = getoptions(h);
There are just no Line properaties at all.
€:2016a

採用された回答

Star Strider
Star Strider 2017 年 11 月 11 日
The Control System Toolbox plotting functions are resistant to most attempts to modify their plot characteristics. If I want a customised plot, I ask for the outputs from the bode, then plot them as ordinary subplot plots:
[mag,phase,wout] = bode(sys);
Example —
sys = tf(4,[1 0.5 4]);
[mag,phase,wout] = bode(sys);
figure(1)
subplot(2,1,1)
semilogx(wout, 20*log10(squeeze(mag)), '-r', 'LineWidth',2)
grid
subplot(2,1,2)
semilogx(wout, squeeze(phase), '-r', 'LineWidth',2)
grid
  2 件のコメント
TS
TS 2017 年 11 月 12 日
Thanks for your answer. Well this is strange, because as stated I can change the plot characteristics ,e.g. the LineStyle property, by inserting them in the function call to plotstep(). Furthermore, I can change the LineWidth properties by manually wich the property editor. So the LineProperties have to exist, yet no way to change them by script? Changing all lines manually is obviously not the way-to go for me.
The alternative is to write my own plotstep()/bode function, which makes the plotstep / plotbode matlab functions utterly useless. So paging @Matlab so fix this, i guess.
Star Strider
Star Strider 2017 年 11 月 12 日
My pleasure.
Allowing more options in the Control System Toolbox functions would be nice. I invite you to submit it as an Enhancement Request through the Contact Us (link).
I just work around it with the code I posted.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePlot Customization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by