How to change the properties of legend?

7 visualizaciones (últimos 30 días)
Emerson De Souza
Emerson De Souza el 16 de Ag. de 2013
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

Respuesta aceptada

dpb
dpb el 16 de Ag. de 2013
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 comentarios
Emerson De Souza
Emerson De Souza el 21 de Ag. de 2013
Thank you, I read your suggestions and tried different things until it worked.
dpb
dpb el 21 de Ag. de 2013
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...

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by