Plot 3D contours and surfaces with axes having the correct values?
Show older comments
I figured out how to plot a 2D (x,y) array full of Z values, but how do I get MATLAB to plot the x,y coordinates on their respective axes?
Accepted Answer
More Answers (1)
Mike Jones
on 21 Sep 2021
0 votes
1 Comment
Kevin Holly
on 21 Sep 2021
x = -15:1:15;
y = x
%Generate Surf Plot
[xg, yg] = meshgrid(x,y);
surf(xg',yg',z)
title('12.5" f/5 Windowed Newtonian - 2.6" Diagonal - 15x15mm FOV')
xlabel('X FOV (mm)')
ylabel('Y FOV (mm)')
view(0,90)
colorbar
colormap(jet)
%Generate Contour Filled
[xg, yg] = meshgrid(x,y);
contourf(xg',yg',z)
title('12.5" f/5 Windowed Newtonian - 2.6" Diagonal - 15x15mm FOV')
xlabel('X FOV (mm)')
ylabel('Y FOV (mm)')
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!