Toolbar Guide GUI Editor - Tool Creation - Brush
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
How can I include a brush tool onto my GUI? This is as far as I get
function uitoggletool_ClickedCallback(hObject, eventdata, handles)
       brush(handles.clean_plot)
guidata(hObject, handles)
Many thanks, Will
댓글 수: 0
채택된 답변
  Adam
      
      
 2015년 3월 5일
        
      편집: Adam
      
      
 2015년 3월 5일
  
      function togglebutton1_Callback(hObject, eventdata, handles)
if hObject.Value == 1
  brush( handles.figure1, 'on' );
else
  brush( handles.figure1, 'off' );
end
seems to work fine for me using a toggle button. Strangely when I tested it at first on a scatter plot using the '*' marker it didn't work, but the same behaviour happened when I just tried on a normal normal figure so I don't know what is going in there. It worked when I used a 's' marker for my scatter plot though in both cases.
handles.figure1 is the tag for the figure itself. I never call mine 'figure1' when i am creating a proper GUI, but this was just a test so that is what it refers to. It must be the figure handle, not an axes handle.
댓글 수: 10
  Adam
      
      
 2015년 3월 6일
				As far as I know the brush will apply to all axes in a figure. I don't see an option to choose an axes for the brushing specifically. It isn't functionality I have ever used myself though, I'm just looking at the help page.
추가 답변 (1개)
  Sung Hwan Heo
 2016년 3월 18일
        Do as follows//
function uitoggletool_brush_ClickedCallback(hObject, eventdata, handles)
if strcmp(get(handles.uitoggletool_brush, 'state'), 'on') brush( handles.figure1, 'on' ); else brush( handles.figure1, 'off' ); end guidata(hObject, handles);
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!