Create and combine quiver and contour plots
Show older comments
Im trying to figure out how to create and combine a quiver plot and a contourf using 4 vectors. I already have the quiver plot done but im stuck on the contourf. What i keep getting with the countourf is:
Error using contourf (line 61)
Z must be at least a 2x2 matrix.
Error in Importingshit (line 9)
contourf(x,y,vx,vy);
For the time being im just trying to get the contourf to work but if someone is willing to help me combine them then i would deffinitly not refuse. Thanks in advance!
1 Comment
Thorsten
on 19 Dec 2014
Please post your data.
Answers (2)
Star Strider
on 19 Dec 2014
0 votes
You’re calling contourf wrong. It doesn’t use the ‘vx’ and ‘vy’ (that I assume you use in your quiver plot). It wants a single square matrix ‘z’, or ‘x’, ‘y’, ‘z’ matrix arguments. See the documentation for it for details.
4 Comments
Paul
on 19 Dec 2014
Star Strider
on 19 Dec 2014
...‘but when i write contourf(x,y) it brings me an error also and when it did work it was wrong’...
- What was the error it threw,
- What was ‘wrong’ when it worked?
Paul
on 19 Dec 2014
Star Strider
on 19 Dec 2014
What are the sizes of x and y?
What is the surface you want to plot? It has to be a matrix, and ideally a function of matrices X and Y. The surface Z must be some function of X and Y if you give it all three arguments.
We don’t have your data or code, so we’re purely guessing here.
Categories
Find more on Vector Fields 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!