How to change the properties of legend?
10 ビュー (過去 30 日間)
古いコメントを表示
INTRO: Hi, I use the command pulsewidth(data,time) to display the width of peaks as described in the example below:
clear all; close all;
% DATA GENERATION
Fs = 1000;
time = 0:1/Fs:1;
Frq = 10;
data = sin(2*pi*time*Frq);
% CALCULATE AND PLOT PULSEWIDTH
pulsewidth(data,time);figure(gcf);
legend('Location', 'NorthEast');
% PLOT PROPERTIES
box on;
set(gca,'FontSize',18, 'FontName','Arial', 'FontWeight','bold','Color','w','LineWidth',3);
xlabel('TIME','FontSize',18, 'FontName','Arial','FontWeight','bold');
ylabel('AMPLITUDE','FontSize',18, 'FontName','Arial','FontWeight','bold');
scrsz = get(0,'ScreenSize'); set(gcf,'Position',scrsz,'PaperPositionMode','auto');
QUESTION: How can I change the thickness of the lines and the sizes of the symbols displayed in the legend?
This legend is generated automatic with the command pulsewidth and I don't have access to the data. The only thing I could do until now was to fix the location of the legend.
I hope someone knows how to help me.
Thanks in advance
Emerson
0 件のコメント
採用された回答
dpb
2013 年 8 月 16 日
From the doc for legend --
LEGH = legend returns the handle to legend on the current axes or empty if none exists.
So, after your call to pulsewidth, include
lh=legend; % return the legend handle
then you can do whatever you want w/ the properties thereof
6 件のコメント
dpb
2013 年 8 月 21 日
That's the way to get somewhere w/ handle graphics--seems daunting 'cuz there's so much folderol to deal with with the large number of objects and properties and there's no way to find in documentation except by a very deep hunt keeping on drilling down so all one can do is dig in and start...
But, once you do it a time or two you get the hang of the general idea and then it's just "handle diving" to find what it is they called whatever the property is that does the effect desired for the most part...
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!