make the x axis ticks invisible of a scatter plot called "s" in matlab in matlab

To make the x-axis ticks invisible on a scatter plot in MATLAB, you can use the set function to modify the 'XTick' property of the current axes. Here's an example code snippet to achieve this:

main.m
% Assuming you already have a scatter plot called "s"
figure
scatter(x, y)  % replace x and y with your data
s = gca;  % get the current axes handle

% Set x-axis tick visibility to 'off'
set(s, 'XTick', 'off')

% Optional: You can also set the x-axis label visibility to 'off'
set(s, 'XLabel', 'off')
302 chars
11 lines

In this example, scatter(x, y) creates a scatter plot with x and y data. Then, we get the current axes handle using gca and store it in the variable s. Finally, we set the XTick property of s to 'off' to make the x-axis ticks invisible.

Note that you may also want to set the x-axis label to be invisible using set(s, 'XLabel', 'off') if you want to hide the x-axis label as well.

gistlibby LogSnag