I am learning to use Matlab / Octave because I will be tutoring a student in a Diffential Equation course this semester in 2nd year Calculus. But my retired passion is violin making and I want to explore Matlabs graphing capabilties in connection with making a graduation map of the thicknesses of a violin back. I have a data file of maybe a couple of hundred points x y z format. The x y is not only the 2D outline of the violin plate but also the locations of where the thickness measurements were taken. z is the thickness of a violin plate in mm. I have followed an example of how to read the data into a matrix and how to reshape the data for the contour plot. Also I am using a color scheme that represents what you would see if you hold the plate in front of a strong light. The problem is the output has white bands separating the contour map ??? What is causing the white bands? The code works so there must be a error in the data file.
xyz=dlmread('backoutline.txt');
x=xyz(:,1);
y=xyz(:,2);
z=xyz(:,3);
colormap(flipud(autumn));
[X,Y]=meshgrid(min(x):max(x),min(y):max(y));
Z=griddata(x,y,z,X,Y);
contourf(X,Y,Z,20);
colorbar();
hold on;
plot (x,y,"o");
0 Comments
Sign in to comment.