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.m302 chars11 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