Plot gradient vector in ContourPlot

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

Discussion Overview

The discussion centers around how to insert gradient vectors into a ContourPlot using Mathematica. Participants explore methods for visualizing these vectors at specific points within the contour plot.

Discussion Character

  • Technical explanation, Exploratory

Main Points Raised

  • One participant inquires about the possibility of adding gradient vectors at specific points in a ContourPlot.
  • Another participant shares a link to the ListVectorPlot function as a potential resource.
  • A later reply indicates that using ListVectorPlot with specific coordinates results in a vector field rather than individual vectors at the desired points.
  • Another suggestion is made to consider the VectorPoints option for addressing the issue.

Areas of Agreement / Disagreement

The discussion does not reach a consensus on the best method to achieve the desired visualization of gradient vectors in the ContourPlot.

Contextual Notes

Participants have not fully resolved how to effectively combine the ContourPlot with the gradient vectors, and there may be limitations based on the specific functions and options available in Mathematica.

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