フィルターのクリア

how to delete the units from a plot

9 ビュー (過去 30 日間)
sebastiaan maes
sebastiaan maes 2019 年 11 月 8 日
回答済み: Kavya Vuriti 2019 年 11 月 11 日
Hi,
I would like to change the x-as to my own text (for example: frequentie [°] ). I did this by de command object.XLabel.String = 'Frequentie [°]'. When I plot my graph I got this: 'Frequentie [°] (deg)'. What option do I need to disable to get rid of the '(deg)' after it?
My code:
opts3 = bodeoptions('cstprefs');
opts3.Title.String = 'Black diagram';
opts3.XLabel.String = 'Fase [°]';
opts3.YLabel.String = 'Versterking (db)';
opts3.grid = 'on';
nichols(g1,opts3) % black diagram
gdxg.JPG

採用された回答

Kavya Vuriti
Kavya Vuriti 2019 年 11 月 11 日
Hi,
There is no option to get rid of units being displayed after X-label and Y-label using Toolbox Preferences Editor. Replacing text using regular expression may help.
fig = figure;
opts3 = bodeoptions('cstprefs');
opts3.Title.String = 'Black diagram';
opts3.XLabel.String = 'Fase [°]';
opts3.YLabel.String = 'Versterking (db)';
opts3.grid = 'on';
nichols(g1, opts3)
labels = findall(fig,'Type','Text');
label = labels(strncmp(get(labels,'String'),'Fase [°]',8));
set(label,'String',regexprep(get(label,'String'),'(\(\w*)\)',''));
Refer to the following link for more information on regexprep:https://www.mathworks.com/help/matlab/matlab_prog/regular-expressions.html#btrug0n-1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by