
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 0.57 KB | hits: 16 | expires: Never
Matlab: Changing the line properties of a loaded figure?
hline = findobj(gcf, 'type', 'line');
set(hline,'LineWidth',3)
set(hline(1),'LineWidth',3)
set(hline(2:3),'LineStyle',':')
idx = [4 5];
set(hline(idx),'Marker','*')
x = 0:0.1:2;
plot(x,sin(x));
fig = gcf % get a handle to the current figure
% get handles to the children of that figure: the axes in this case
ax = get(fig,'children')
% get handles to the elements in the axes: a single line plot here
h = get(ax,'children')
% manipulate desired properties of the line, e.g. line width
set(h,'LineWidth',3)