Turning off auto-grouping of lines into lineseries

조회 수: 2 (최근 30일)
David Goldsmith
David Goldsmith 2011년 3월 16일
Hi! I've painfully stumbled across the following very baffling and infuriating "feature": it would appear that upon adding a fifth line object to a single axis, MATLAB unilaterally and without user notification groups up all existing and subsequent lines on that axis into a lineseries, which then prevents the brush on command from providing those lines with the BrushData property! To whit: I have an axis w/ two lines on which brushing and brush linking was working fine. I added a bunch more lines and suddenly a BrushEnd event handler I have returns the error "??? Error using ==> set There is no 'BrushData' property in the 'lineseries' class." Several hours and much hair wringing later, I finally try adding just one more line at a time: add one more line and it works fine. Add another line, works fine. Add one more line and "??? Error using ==> set There is no 'BrushData' property in the 'lineseries' class." CAN IT REALLY BE THAT AFTER ONLY FOUR LINES MATLAB UNILATERALLY AND WITHOUT USER NOTIFICATION GROUPS UP LINES INTO A LINESERIES OBJECT, WHICH THEN PREVENTS BRUSH ON FROM BEING ABLE TO PROVIDE THEM WITH THE BRUSHDATA PROPERTY!!?? AAARRGGGHH!!?? HOW DO I TURN THIS CRAZY THING OFF (or at least raise the limit at which it operates)?

답변 (3개)

Walter Roberson
Walter Roberson 2011년 3월 16일
Lines are not autogrouped into lineseries.
I happened to find your discussion in a different thread and answered there first. See here
  댓글 수: 2
David Goldsmith
David Goldsmith 2011년 3월 16일
Can you explain the phenomenon I'm observing, namely that up to a certain number of lineseries (I'm always using plot) added to an axis, brush on adds the BrushData property to them, but above that number, it doesn't?
Walter Roberson
Walter Roberson 2011년 3월 16일
I've never used BrushData, and at the moment I don't have a (useable) graphic connection to my server that I could experiment with, sorry.

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


Matt Fig
Matt Fig 2011년 3월 16일
I am a little confused. All of the objects returned by the PLOT function are lineseries objects. Can you give an example FOR loop which shows the error? Something like:
for ii = 1:5
L(ii) = plot(1:ii);
set(L(ii),....)
end
  댓글 수: 1
David Goldsmith
David Goldsmith 2011년 3월 16일
I'll try (I have a few more things I've thought of to try; if they don't work, I'll try to generate a "minimal reproducer.")

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


David Goldsmith
David Goldsmith 2011년 3월 16일
It appears to be an undocumented (or at least I can't find it documented) feature of brushing, to whit:
x=-1:0.1:1;
y=x'*x;
figure
plot(x,y)
brush on
brushlines=findobj(gcf,'-property','BrushData');
length(brushlines)
ans =
20
hold
Current plot held
brush off
brushlines=findobj(gcf,'-property','BrushData');
length(brushlines)
ans =
20
% ??????????????????
plot(y,x)
brush on
brushlines=findobj(gcf,'-property','BrushData');
length(brushlines)
ans =
20
lines=findobj(gcf,'Type','line');
length(lines)
ans =
42
% Maybe it depends on when one turns brushing on?
% Let's plot(x,y) and plot (y,x) then turn brushing on:
clf
% make sure I haven't inadvertently corrupted my data
size(x), size(y)
ans =
1 21
ans =
21 21
  댓글 수: 1
David Goldsmith
David Goldsmith 2011년 3월 16일
Sorry, my browser's acting up on me:
plot(x,y)
hold
Current plot held
plot(y,x)
brush on
lines=findobj(gcf,'Type','line');
length(lines)
ans =
42
brushlines=findobj(gcf,'-property','BrushData');
length(brushlines)
ans =
0
% !!!!! Even I wasn't expecting that: before when I did it I got 20
Clearly I don't understand this brushing w/ multiple lines very well, but just as clearly, IMO, its behavior is very unintuitive!
In any event, I solved my problem at hand: the extra functions I needed to plot were constant functions, so naively, I was doing plot(vector, scalar), which was generating a new line object for each point! I switched to plot(vector, constant-valued vector) so each new function generated only one line object and this kept the total down sufficiently that brush on is working again. Nevertheless, I'm quite (re-)disillusioned...

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

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by