Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. ClearAll["Global`*"];
  2. f[x_, y_] := x + y^-1;
  3. p = ContourPlot[
  4. f[x, y], {x, -5, 5}, {y, -5, 5},
  5. Contours -> 10,
  6. ContourLabels -> True,
  7. LabelStyle -> {Directive[Bold, Medium], White,
  8. RotateLabel -> True},
  9. ImageSize -> Large
  10. ]
  11.  
  12. f[x_, y_] := x + y^-1
  13. t[x_, y_] = Grad[f[x, y], {x, y}] . {{0, -1}, {1, 0}};
  14.  
  15. ContourPlot[
  16. f[x, y],
  17. {x,-5,5},
  18. {y,-5,5},
  19. Contours->10,
  20. ContourLabels->Function[{x,y,z},Text[z,{x,y},{0,0},t[x,y], BaseStyle->FontColor->White]]
  21. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement