How to change the properties of legend?

11 次查看(过去 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

采纳的回答

dpb
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 个评论
Emerson De Souza
Emerson De Souza 2013-8-21
Thank you, I read your suggestions and tried different things until it worked.
dpb
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 CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by