Data Brushing Callback; Assign (Keep) Brush Color
5 ビュー (過去 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!