Data Brushing Callback; Assign (Keep) Brush Color
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi, I have created a callback function for data brushing (called with 'ActionPostCallback'). When I use the brush, I always set the color to Magenta ('Color',[1 0 1]) so that the brushed points are visible (some of my graphs contain red points, the default brush color).
However, when I the callback is used, the brush color is reset to the default red. I have tried setting the color ('MarkerEdgeColor') of the brush handle to magenta in the callback, but this results in an error (Below this paragraph). I think the error results from my trying to modify the brush handle inside of the callback for that handle.
Callback Error:
Warning: An error occurred during the mode callback.
> In uitools.uimode.fireActionPostCallback at 14
In datamanager.brushup at 114
In brush>@(es,ed)datamanager.brushup(es,ed)
In hgfeval at 63
In uitools.uimode.modeWindowButtonUpFcn at 46
In uitools.uimode.modeControl>localModeWindowButtonUpFcn at 155
My question is : Is there anyway for me to maintain my choice of brush color, or to assign a brush color inside of the callback? Thanks for the help!
Code For activating brushing:
hBrush = brush(figHandle);
set( hBrush,'ActionPostCallback', @(ohf, s) brushDataCallback, 'enable', 'on', 'Color', [1 0 1] )
Code in Callback to set color to Magenta
% Update All figures with Brushed Data
figHandles = findall(0,'Type','figure');
for ii = 1:length(figHandles)
brDataFig = findobj(figHandles(ii),'-property','BrushData');
set(brDataFig,'BrushData',brDataInd)
hb = findall(figHandles(ii),'Tag','Brushing');
set(hb,'MarkerEdgeColor',[1 0 1]);
% NOTE: I have also tried properties 'MarkerFaceColor' and 'Color', neither worked
end
Other References for Brushing: http://www.mathworks.com/help/matlab/ref/brush.html http://www.mathworks.com/matlabcentral/answers/8147
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!