|
"Dave Smith" <ospa56@bangor.ac.uk> wrote in message <he3t44$l$1@fred.mathworks.com>...
> I am using the following code to produce a contourf plot:
>
> contourf(AttInterp(:,2:44))
> caxis([0 12]);
> colorbar;
> set(gca,'YDir', 'reverse');
> title('Attenuation over CTD Station');
>
> The problem I am having is that the y-axis plots as 0-40, in line with the number of rows of data, but I need it to go from 0-20 in 0.5 intervals, in line with what it should actually be.
>
> Column 1 in AttInterp is the values 0-20 in 0.5 intervals, hence why contourf(AttInterp(:,2:44)) starts at column 2.
>
> I'm pretty new to MatLab and would appreciate any help!
Hi Dave, if you look at
>>doc contourf
you can create your own X and Y axes of the proper length to use as input arguments to contourf
Z = peaks(20);
X = 0:0.5:10-0.5;
Y = 0:0.5:10-0.5;
contourf(X,Y,Z)
Wayne
|