How to remove the space between plotted data and the axis (surf)?

6 views (last 30 days)
Is it possible to remove the space between the axis and the plot? The problem:
I using surf and x-y view. Other plot functions such as contour are not an option in my case.
Minimum working example:
plot_data=rand(25,25);
surf(plot_data)
grid on
axis square
set(gcf,'color','w')
view(0, 90)
Thanks for the help!

Accepted Answer

Star Strider
Star Strider on 17 Jan 2015
Adding ‘axis tight’ seems to do what you want:
plot_data=rand(25,25);
surf(plot_data)
grid on
axis square
set(gcf,'color','w')
view(0, 90)
axis tight
To wit:

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!