Problem with MATLAB unnecessarily averaging data points.

1 view (last 30 days)
I'm having a problem with MATLAB unnecessarily averaging my data points in the plotting of a filled contour plot.
x values: 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 2333.96 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 3384.228 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 4689.437 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 5488.413 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 6539.973 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7216.716 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 7835.407 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8148.825 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 8679.832 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9135.001 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9355.322 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 9691.066 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10264.31 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 10978.62 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55 11585.55
y values: 3.599 3.467 3.397 3.326 3.211 3.123 3.07 3.044 3.009 2.956 2.947 2.938 2.894 2.885 2.876 2.859 2.841 2.815 2.806 2.779 2.726 2.585 2.215 1.739 1.218 0.68 0.274 0.053 0.027 0.009 0.00001 3.122 2.911 2.867 2.814 2.734 2.664 2.646 2.629 2.576 2.593 2.558 2.426 2.161 1.755 1.244 0.732 0.326 0.061 0.00001 2.478 2.354 2.302 2.266 2.213 2.161 2.116 2.081 2.072 2.046 1.993 1.949 1.896 1.87 1.861 1.834 1.808 1.79 1.773 1.755 1.711 1.543 1.138 0.82 0.617 0.582 0.573 0.511 0.467 0.441 0.423 0.388 0.379 0.361 0.353 0.344 0.326 0.15 0.00001 1.199 0.988 0.917 0.891 0.794 0.688 0.662 0.626 0.609 0.582 0.565 0.485 0.459 0.441 0.415 0.406 0.335 0.282 0.247 0.08 0.027 0.009 0.00001 1.322 1.111 1.014 0.935 0.882 0.846 0.838 0.785 0.723 0.705 0.697 0.67 0.635 0.617 0.476 0.317 0.247 0.203 0.079 0.035 0.00001 1.605 1.288 1.076 0.979 0.953 0.935 0.917 0.9 0.882 0.865 0.856 0.847 0.785 0.688 0.538 0.371 0.274 0.159 0.044 0.00001 0.917 0.706 0.697 0.679 0.662 0.644 0.635 0.618 0.609 0.591 0.556 0.503 0.485 0.441 0.327 0.203 0.053 0.00001 1.155 0.953 0.732 0.653 0.6 0.582 0.565 0.556 0.521 0.45 0.432 0.388 0.344 0.327 0.309 0.3 0.282 0.274 0.221 0.141 0.044 0.018 0.00001 1.763 1.525 1.331 1.296 1.278 1.226 1.19 1.173 1.129 1.076 1.049 1.023 1.005 0.987 0.961 0.952 0.943 0.908 0.899 0.802 0.52 0.194 0.061 0.044 0.035 0.026 0.00001 1.146 0.802 0.591 0.485 0.467 0.441 0.414 0.379 0.37 0.291 0.088 0.053 0.044 0.026 0.00001 1.799 1.623 1.393 1.235 1.147 1.138 1.12 1.103 0.873 0.556 0.212 0.15 0.106 0.018 0.00001 1.464 1.341 1.129 0.918 0.829 0.812 0.785 0.75 0.724 0.706 0.697 0.688 0.679 0.653 0.53 0.318 0.265 0.186 0.036 0.00001 3.034 3.026 2.955 2.779 2.594 2.356 2.25 2.197 2.162 2.144 2.126 2.118 2.1 2.091 2.073 2.065 1.932 1.694 1.377 0.556 0.292 0.212 0.133 0.036 0.009 0.00001 1.428 1.331 1.252 1.128 1.04 0.926 0.793 0.776 0.767 0.749 0.688 0.652 0.52 0.326 0.255 0.114 0.00001 2.187 2.178 2.073 1.843 1.623 1.552 1.508 1.473 1.455 1.447 1.42 1.411 1.394 1.138 0.688 0.3 0.115 0.00001
z values: 33.431 33.42 33.409 33.398 33.41 33.398 33.406 33.406 33.398 33.397 33.398 33.391 33.389 33.387 33.389 33.382 33.384 33.388 33.391 33.382 33.403 33.406 33.404 33.39 33.382 33.377 33.375 33.375 33.373 33.37 33.374 24.883 25.163 25.297 25.482 25.197 25.223 26.802 26.739 26.737 26.395 26.501 26.614 28.404 29.424 29.633 29.632 29.646 29.651 29.659 19.708 19.669 19.599 19.418 19.696 19.713 19.72 19.735 19.741 19.744 19.74 19.606 19.701 19.622 19.653 19.605 19.553 19.563 19.593 19.644 19.197 19.445 19.84 20.056 20.04 20.07 20.033 20.053 20.071 20.075 20.098 20.109 20.126 20.13 20.116 20.141 20.067 19.871 19.908 4.9039 5.0859 4.7893 4.742 4.7973 4.7324 4.7231 4.7562 4.7279 4.7244 4.7289 4.7425 4.7182 4.7394 4.7151 4.7215 4.7128 4.7042 4.7051 4.7051 4.702 4.7032 4.7009 0.3186 0.3075 0.3245 0.3228 0.3219 0.3228 0.3309 0.3282 0.3373 0.349 0.3509 0.35 0.3508 0.3517 0.3482 0.3436 0.3454 0.3418 0.3391 0.3382 0.3373 0.1059 0.1051 0.106 0.1068 0.1068 0.1069 0.1069 0.1069 0.1069 0.1069 0.1094 0.1103 0.1094 0.1094 0.1154 0.118 0.118 0.118 0.1189 0.1189 0.1693 0.1711 0.1721 0.1722 0.1722 0.1696 0.1705 0.1679 0.1627 0.1601 0.1601 0.1619 0.1419 0.1488 0.1428 0.1384 0.1376 0.1376 0.0476 0.0474 0.0472 0.048 0.0472 0.0489 0.0472 0.0472 0.048 0.0489 0.0472 0.048 0.0472 0.0472 0.0472 0.048 0.048 0.048 0.048 0.0472 0.0472 0.0472 0.0472 0.0399 0.0399 0.0399 0.0407 0.0407 0.0407 0.0407 0.0407 0.0407 0.0399 0.0407 0.0407 0.0407 0.0407 0.0407 0.0407 0.0407 0.0407 0.0399 0.0399 0.0399 0.0399 0.0399 0.0399 0.0399 0.0399 0.0399 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0342 0.0318 0.0326 0.0326 0.0326 0.0326 0.0318 0.0326 0.0318 0.0326 0.0326 0.0326 0.0326 0.0326 0.0326 0.0326 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.0318 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.027 0.0278 0.0294 0.0294 0.0302 0.0302 0.0302 0.031 0.0302 0.0302 0.0302 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0262 0.0254 0.0246 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254 0.0254
This is the code I used to create my contour plot: %invent some x,y,z data [qx,qy]=meshgrid(linspace(min(x),max(x)),linspace(min(y),max(y))); qz=griddata(x,y,z,qx,qy); contourf(qx,qy,qz)
This is the error MATLAB gave me: Warning: Duplicate x-y data points detected: using average of the z values. > In griddata at 83 In dyfi1 at 3 Warning: qhull precision warning: The initial hull is narrow (cosine of min. angle is 0.9999999999999998). A coplanar point may lead to a wide facet. Options 'QbB' (scale to unit box) or 'Qbb' (scale last coordinate) may remove this warning. Use 'Pp' to skip this warning. See 'Limitations' in qh-impre.htm.
Can anyone help?

Answers (1)

the cyclist
the cyclist on 17 Mar 2011
You presumably have instances of x-y data that have different z values. How do you want to handle that? To avoid the error, you need to manage that situation before you send the data to griddata.

Categories

Find more on Contour Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!