Stop contourf from interpolating between my grid
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
even coil
am 11 Jun. 2015
Beantwortet: even coil
am 15 Jun. 2015
I am using a contourf plot of the form: contourf(B0, B1, Z)
The spacing of B0 and B1 is .05.
The function values in Z only take on a few discrete values.
The resulting behavior is that if say Z(b0,b1) = 1 and Z(b0+1,b1) = 2, then MATLAB draws many contours between the two points, thereby creating many lines between the two points.
Is there a way to prevent this behavior?
My initial thought was to try to specify the number of contours directly. However, when this is done MATLAB just fills the region between the two points with one of the other colors being used, which is also not appropriate.
1 Kommentar
Walter Roberson
am 12 Jun. 2015
What is the form of Z? Is it a scalar, a vector of sorted values, an array?
Akzeptierte Antwort
Weitere Antworten (2)
Walter Roberson
am 12 Jun. 2015
If your Z is an array then you are using the contourf(X,Y,Z) form, and you instead want to use the contourf(X,Y,Z,v) form. As there are only a few discrete values, then
contourf(B0,B1,Z,unique(Z(:));
0 Kommentare
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


