/usr/share/freemat/toolbox/graph/grid.m is in freemat-data 4.0-5build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | % GRID GRID Plot Grid Toggle Function
%
% Usage
%
% Toggles the drawing of grid lines on the currently active plot. The
% general syntax for its use is
%
% grid(state)
%
% where state is either
%
% grid('on')
%
% to activate the grid lines, or
%
% grid('off')
%
% to deactivate the grid lines. If you specify no argument then
% grid toggles the state of the grid:
%
% grid
%
% You can also specify a particular axis to the grid command
%
% grid(handle,...)
%
% where handle is the handle for a particular axis.
% Copyright (c) 2002-2006 Samit Basu
% Licensed under the GPL
function h = grid(varargin)
if (nargin == 0)
grid_toggle(gca);
elseif (strcmp(varargin{1},'on'))
grid_on(gca);
elseif (strcmp(varargin{1},'off'))
grid_off(gca);
elseif (ishandle(varargin{1}))
if (nargin == 1)
grid_toggle(varargin{1})
elseif (strcmp(varargin{2},'on'))
grid_on(varargin{1});
elseif (strcmp(varargin{2},'off'))
grid_off(varargin{1});
else
error('Unrecognized form of grid');
end
else
error('Unrecognized arguments to grid');
end
function grid_toggle(handle);
if (strcmp(get(gca,'xgrid'),'on') | ...
strcmp(get(gca,'ygrid'),'on') | ...
strcmp(get(gca,'zgrid'),'on'))
grid_off(handle);
else
grid_on(handle);
end
function grid_off(handle)
set(gca,'xgrid','off');
set(gca,'ygrid','off');
set(gca,'zgrid','off');
function grid_on(handle)
set(gca,'xgrid','on');
set(gca,'ygrid','on');
set(gca,'zgrid','on');
|