2
$\begingroup$

Is it possible to overlay parametrized curves on two-dimensional vector plots?

For example, I'd like to be able to overlay circles

$$\mathbf{c}(t)=\langle R\cos t+h, R\sin t+k\rangle$$

(for specific values of $R, h, k$) on

VectorPlot[{x, y}, {x, -5, 5}, {y, -5, 5}]

In fact, I'd really like to be able to overlay the circles as well as their tangent and normal vector fields, shown in a different color than the underlying field.

The documentation doesn't give examples of this sort. Perhaps it could be done by using a second field for which the circle I desire to plot is a streamline?

$\endgroup$
  • 1
    $\begingroup$ ParametricPlot and Show is one way. $\endgroup$ – Michael E2 Feb 8 '18 at 1:24
  • $\begingroup$ Show[Graphics[Circle[]], VectorPlot[{x, y}, {x, -5, 5}, {y, -5, 5}]] $\endgroup$ – David G. Stork Feb 8 '18 at 1:39
  • $\begingroup$ VectorPlot[{x, y}, {x, -5, 5}, {y, -5, 5}, Epilog -> ParametricPlot[ Evaluate[ Join @@ Table[{r Cos[t] + h, r Sin[t] + k}, {r, 1, 4, 1}, {k, -1, 1, 1}, {h, -1, 1, 1}]], {t, 0, 2 Pi}][[1]]]? $\endgroup$ – kglr Feb 8 '18 at 1:44
  • $\begingroup$ Thanks for all the solutions; I didn't know Show. Show[ParametricPlot[ {Cos[t] - 1, Sin[t] - 1}, {t, 0, 2*Pi}], VectorPlot[{x, y}, {x, -10, 10}, {y, -10, 10}], PlotRange -> {{-10, 10}, {-10, 10}}, AxesOrigin -> {0, 0} gives a nice solution. $\endgroup$ – symplectomorphic Feb 8 '18 at 1:45
3
$\begingroup$
Manipulate[VectorPlot[{x, y}, {x, -5, 5}, {y, -5, 5}, 
 Epilog -> ParametricPlot[{r Cos[t]+h, r Sin[t] + k}, {t, 0, 2 Pi}, PlotStyle->Red][[1]]],
  {{r, 2, "r"}, 1, 4}, {{h, 0, "h"}, -1, 1}, {{k, 0, "k"}, -1, 1}]

enter image description here

$\endgroup$
  • $\begingroup$ Terrific -- you read my mind. Thanks! $\endgroup$ – symplectomorphic Feb 8 '18 at 1:49
  • $\begingroup$ @symplectomorphic, my pleasure. Thank you for the accept. $\endgroup$ – kglr Feb 8 '18 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.