How can I increase the resolution of Contourf plot?
45 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Steven Lord
on 21 Aug 2019
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.
See Also
Categories
Find more on Surface and Mesh 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!