Contourf (x,y,z) with unequal columns for y

I am trying to use contourf to contour longitude(x), depth(y) and process(z). Each of my depth columns are unequal for each longitude column. For example Longitude 1 goes from 0 to -12 and Longitude 2 goes from 0 to -10. I want to plot each longitude with the depth and the process (no interpolating to make each depth column equal), so it resembles the sea floor. However, I cannot seem to get anything to work. I would appreciate any suggestions and hope this my question is clear enough to understand.

Answers (1)

You could try using y as a full matrix, and putting nan in at the places that are not populated.
If your y that are there are the same for each latitude, then you can use vector x and y and matrix z with nan in the parts of z that are not populated. I am more certain that this approach will work than putting nan in the y.

3 Comments

Hi Walter! Not sure I understand ... Let me try this way and see it your answer makes senses. Station 1 has longitude (-90.5), depth (0.5 , 1, 1.5, 2, down to 10), process(for each depth) Station 2 has longitude (-91 for all steps), depth (0.5, 1, 1.5, down to 13), process (for each step) and so on. So Y's are different for each station and longitude. I tried the NaN, but you cannot see how the lowest depth changes as you move from station to station (vertical profile in x-direction)
lats = [-90.5 -91]; %etc
depths = 0.5 : 0.5 : 13; %to the maximum used depth
tprocess = process;
tproces(1, 21:end) = nan; %unpopulated at lat #1
contourf(lats, depths, tprocess);
Thanks I will try this today!

Sign in to comment.

Categories

Asked:

on 3 Oct 2012

Community Treasure Hunt

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

Start Hunting!