Smooth out a 3D Plot
Show older comments
I have a large data file that consists of 4 columns (all columns are integer values); shear exponent, wind speed, pressure and temperature and each column has 51062 data points. I have created a 3D plot of shear exponent vs temperature vs wind speed (Figure 1 attached) and shear exponent vs density vs wind speed (Figure 2 attached) from the data I have/calculated.
However the plots came out a bit chunky. I would like the graphs to be more smooth like Figure 3 (attached). Please note that Figure 3 was just an image I copied an pasted from google.Is there any way to generate an image like Figure 3 from my data in Matlab? I feel like this should be possible to do in Matlab but if I'm asking for something huge please let me know as I have very little experience with Matlab.
Thank you in advance for your help.
Below is the MATLAB code I used to plot the 3D graphs.
figure;
tri1 = delaunay(shearexponent,temperature);
trisurf(tri1,shearexponent,temperature,windspeed)
xlabel('Wind Shear Exponent');
ylabel('Temperature (deg. Celsius)');
zlabel('Wind Speed (m/s)');
figure;
tri2 = delaunay(shearexponent,density);
trisurf(tri2, shearexponent,density,windspeed)
xlabel('Wind Shear Exponent');
ylabel('Density (kg/m3)');
zlabel('Wind Speed (m/s)');
Answers (1)
Image Analyst
on 31 Dec 2016
Maybe try smoothing your 2-D array with conv2(). Let's say you create an image where the columns are the 'Wind Shear Exponent', and the rows are 'Temperature', and the values in the image are 'Wind Speed'. So you can just do
windowSize = 5; % Bigger window size gives more smoothing.
kernel = ones(windowSize, windowSize) / windowSize ^ 2;
blurredImage = conv2(your2DData, kernel, 'same');
imshow(blurredImage);
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!