This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


HamiltonianFieldPlot[f, {x, xmin, xmax}, {y, ymin, ymax}]
generates a plot of the Hamiltonian vector field of the scalar-valued function f as a function of x and y.
HamiltonianFieldPlot[f, {x, xmin, xmax, dx}, {y, ymin, ymax, dy}]
uses steps dx in variable x, and steps dy in variable y.
  • The derivatives of f are calculated analytically.
  • HamiltonianFieldPlot has the same options as Graphics, with the following additions and changes:
ColorFunctionNonea function to use for coloring the vectors by their magnitude
MaxArrowLengthNonelength of the largest vector to be drawn, applied after the ScaleFunction, but before the ScaleFactor
PlotPoints15the number of evaluation points in each direction
ScaleFactorAutomaticlinearly rescales the vectors so the longest vector is equal to this value; Automatic fits the vectors in the mesh, None eliminates the rescaling
ScaleFunctionNonea function to use for rescaling the magnitude of vectors
Hamiltonian vector field of sin(x y) as x and y run from 0 to 2 pi:
Click for copyable input