How to control the visibility of gridlines of an axes through a checkbox in GUIDE?
    3 ビュー (過去 30 日間)
  
       古いコメントを表示
    
    Vinothkumar Sethurasu
 2021 年 6 月 10 日
  
    
    
    
    
    コメント済み: Image Analyst
      
      
 2021 年 6 月 11 日
            I have application to swich off the visibility of the initially created gridlines of an axes by enabling the check box.
The gridlines were created through create function by providing Xtick & Ytick values.
0 件のコメント
採用された回答
  Walter Roberson
      
      
 2021 年 6 月 10 日
        For example
function pushbutton1_Callback(hObject, event, handles)
    gridon = get(hObject, 'Value');
    if gridon
       set(handles.axes1, 'grid', 'on');
    else
        set(handles.axes1, 'grid', 'off');
    end
3 件のコメント
  Walter Roberson
      
      
 2021 年 6 月 11 日
				
      編集済み: Walter Roberson
      
      
 2021 年 6 月 11 日
  
			function pushbutton1_Callback(hObject, event, handles)
    if get(hObject, 'Value')
        grid(handles.axes1, 'on');
    else
        grid(handles.axes1, 'off');
    end
その他の回答 (1 件)
  Image Analyst
      
      
 2021 年 6 月 11 日
        See my attached demo.
In particular, check out these lines of code:
% Make the grid color yellow.
ax.GridColor = 'y';
ax.GridAlpha = 0.9; % Set's transparency of the grid.
That will let you control the color and opacity of the grid lines.  Of course you can turn them totally off or on with
grid on  % Works on the current axes
grid off  % Works on the current axes
Pass in the axes handle like Walter showed if you want to operate on an axes that is not the current one.
2 件のコメント
  Aiswarya Babu
 2021 年 6 月 11 日
				help me to store data as a text file.
These are the values i need to store as a text file . 
29 C3 50 5F 57 14 20 F6 40 22 99 B3 1A 02 D7 3A
Kindly help me.
Thanks in advance
  Image Analyst
      
      
 2021 年 6 月 11 日
				@Aiswarya Babu, this has nothing at all to do with my answer to @Vinothkumar Sethurasu.  You should have started a completely new question.
fid = fopen('data.txt', 'wt');
fprintf(fid, '29 C3 50 5F 57 14 20 F6 40 22 99 B3 1A 02 D7 3A\n');
fclose(fid);
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!