How can I increase the resolution of Contourf plot?
47 次查看(过去 30 天)
显示 更早的评论
Hello everyone!
Could you please help me with this:
I have a 8×8 grid which I want to use in order to plot some Z values in the contourf.
However, I interpolated my data to generate more point using griddata function. Now the number of values inside Z matrix ofcourse increases.
What I want to see on the contourf is the new Z matrix but with same (x,y) values. In this way the resolution will increase thanks to more datapoints in Z.
The problem is MATLAB asks for the same dimensions for (x,y) to produce corrosponding values in matrix Z.
Do you know how can I fix this?
2 个评论
回答(1 个)
Steven Lord
2019-8-21
contourf(Z)%this will give the contourf with increased x,y axis!
That's correct. What does contourf use as X and Y coordinates if you call it with only one input? From the documentation: "contourf(Z) creates a filled contour plot containing the isolines of matrix Z, where Z contains height values on the x-y plane. MATLAB® automatically selects the contour lines to display. The row and column indices of Z are the x and y coordinates in the plane, respectively."
When you called contourf on your coarser data you passed X and Y in, which "specifies the x and y coordinates for the values in Z." Pass the finer grid coordinates into contourf the same way.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!