Contour with discrete (x,y) and continuous z
Show older comments
I have a 3D data in which the x and y are piece-wise constant and z is constant in the interval of x and y. I would like to plot them with Matlab contourf function. The problem is that for an interval x,y the value z is interpolated. For example for x between x1 and x2 and y between y1 and y2, the value of z is k. Currently contourf in Matlab plots the interpolation of z around the region of x1,x2 and y1,y2. How can I keep the values of z is set constant in region between x1 and x2 and y1 and y2?
Thank you in advance.
Zul
Accepted Answer
More Answers (2)
Fangjun Jiang
on 16 Jul 2011
I am not sure if I fully understand your need. Does the following options for contourf() fit you need?
[x,y,z]=peaks(10);
figure(1);contourf(x,y,z);
figure(2);contourf(x,y,z,10);
figure(3);contourf(x,y,z,z);
Or do you want to achieve the same effect as below but want to apply to 3D?
figure(4);plot(1:50);
figure(5);stairs(1:50);
2 Comments
Zulkifli Hidayat
on 16 Jul 2011
Fangjun Jiang
on 16 Jul 2011
Please provide an example with small number of data. I don't think contourf() is the right function to look at at the first place.
Zulkifli Hidayat
on 16 Jul 2011
0 votes
Categories
Find more on Contour 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!