How does one set the line style for the plotted traces on the dsp.SpectrumAnalyzer object in the script?
3 次查看(过去 30 天)
显示 更早的评论
When using the dsp.SpectrumAnalyzer and displaying a spectrum, the plotted trace thickness can be selected in the Spectrum Analyzer window (after the plot) by going to View > Style... and adjusting the items in the style window. The line thickness is set to 0.5 by default which I would like to set higher. Is there a way to specify the line thickness in the plotted trace to something different (like 1 or 2) in the scripted properties for the dsp.SpectrumAnalyzer rather than changing it after it's been plotted?
0 个评论
采纳的回答
Sachin Meena
2018-8-29
Currently, the dsp.SpectrumAnalyzer by itself does not provide you with the option to change the line width. One of the possible workarounds that you can try is to find all the line objects in your plot and then change their linewidth, like following.
line=findall(0,'type','line'); %finding the line in the figure
line.LineWidth=3; %or whatever you wish it to be
Note that "gca" and "gcf" won't work on this figure unless you turn on the handle visibility property to on (by default it is off).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!