Plot gradient vector in ContourPlot

  • Context: Mathematica 
  • Thread starter Thread starter Lambda96
  • Start date Start date
  • Tags Tags
    Gradient Plot Vector
Click For Summary
SUMMARY

The discussion centers on incorporating gradient vectors into a ContourPlot using Mathematica. The user, Orodruin, seeks to plot specific gradient vectors at defined points, namely \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). The suggested approach involves using ListVectorPlot to achieve this, though the user encounters an issue where Mathematica generates a vector field instead of the desired vectors at specific points. The discussion highlights the importance of the VectorPoints option in customizing the output.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of gradient vectors and their representation
  • Knowledge of ContourPlot and ListVectorPlot functions
  • Basic concepts of vector fields in mathematical visualization
NEXT STEPS
  • Explore the VectorPoints option in Mathematica for customizing vector plots
  • Learn how to manipulate ListVectorPlot for specific vector placements
  • Investigate gradient calculation methods in Mathematica
  • Review examples of advanced ContourPlot customizations in Mathematica documentation
USEFUL FOR

Mathematics educators, data scientists, and anyone using Mathematica for visualizing mathematical concepts, particularly those interested in vector fields and contour plots.

Lambda96
Messages
233
Reaction score
77
TL;DR
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

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
19
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K