Mathematica Plot gradient vector in ContourPlot

AI Thread Summary
The discussion centers on incorporating specific gradient vectors into a ContourPlot in Mathematica. The user aims to plot vectors at designated points, specifically at coordinates r1, r2, and r3. They initially attempted to use ListVectorPlot to achieve this but encountered issues as it resulted in a vector field rather than the desired placement of individual vectors. The conversation highlights the need to explore the VectorPoints option within ListVectorPlot to correctly position the vectors on the ContourPlot. The user seeks guidance on how to effectively integrate these vectors into their existing plot.
Lambda96
Messages
233
Reaction score
77
TL;DR Summary
Plot gradient vector in ContourPlot
Hi,

I have made the following ContourPlot in mathematica and now I wanted to ##\vec{r}_1= \left(\begin{array}{c} -1 \\ 1 \end{array}\right)##, ##\vec{r}_2= \left(\begin{array}{c} 0 \\ \sqrt{2} \end{array}\right)## and ##\vec{r}_3= \left(\begin{array}{c} 1 \\ 1 \end{array}\right)## insert the gradient into the ContourPlot.

Bildschirmfoto 2023-12-11 um 15.33.19.png


Is this possible and if so, how?
 
Physics news on Phys.org
Thank you Orodruin for your help 👍

Since I want to have the vectors at certain points in the ContourPlot, I used ListVectorPlot[{{x1,y1},{vx1,vy1}},...}].

Unfortunately, Mathematica then plots a vector field

Bildschirmfoto 2023-12-12 um 12.35.57.png
 
Check out the VectorPoints option
 

Similar threads

Back
Top