Change linespec of a line using only the figure handle.

조회 수: 5 (최근 30일)
carlas
carlas 2012년 5월 29일
Dear all,
I was wondering how I can change the linespec of a set of lines when I already plotted the lines and only have the figure handle. The figure handle is obtained using h=hgload('bla.fig');
Kind regards,
Carlas

답변 (3개)

Sean de Wolski
Sean de Wolski 2012년 5월 29일
hAxChild = get(get(gcf,'children'),'children'); %children of the figure's axes
Then figure out which ones are lines etc..

Wayne King
Wayne King 2012년 5월 29일
Can't you just edit plot from the figure window, then click on the line?
Or click on the object and do:
hco = gco;
set(hco,'linestyle','-.');
for example.
  댓글 수: 1
carlas
carlas 2012년 5월 29일
No I cannot because two lines completely overlap and apart from that i would love to know how to access the low level objects for future purposes.
Is there a way to get an array with gcos?

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2012년 5월 29일
objs = findobj(h, 'Type', 'line');
However, there might be lots of lines and you probably only want to change the width or color or style of some of them. If you were to examine a line object or lineseries object in isolation, would you be able to tell whether it is the one you want to change?

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by