2D Functions
Function Plot
Parametric Plot
Multiple Parametric Plot
Filled Plot
Multiple Filled Plot
Logarithmic Plot


2D Data Plots
Data Plot
Data Error Plot
Data Logarithmic Plot
Data Labeled Plot


Contour & Density Plots
Contour Plot
Density Plot
Level Curves


3D Functions
3D Function Plot
3D Parametric Plot
3D Multiple Parametric Plot
3D Vector Field
3D Gradient Field
Shadow 3D Function

3D Data Plots
Contour 3D Data Plot
Density 3D Data Plot


Special Plots
Vector Field
Bar Charts
Pie Chart
Zonotope Show


Links
About This Site
Citation & Credits
Sci.Vis. Tutorials
webComputing


Plot of Vector Fields

Anything that assigns a magnitude and direction at each point gives a vector field. Examples include the electromagnetic field and the velocity field of a fluid. Any ordinary differential equation can be used to define a vector field. These vector fields can be visualized by drawing arrows representing the vectors. The direction of the arrow is equal to the direction of the vector field at its base point. The magnitude of the arrow is proportional to the magnitude of the vector field.

Plot Vector Field

Plot the vector field given by a vector-valued function in the range specified.


Enter a function of x :   " >   

Plot Range :   " >   <= x <=   " >

Enter a function of y :   " >   

Plot Range :   " >   <= y <=   " >

Plot Gradient Field and Hamiltonian Field

The two components of the function's Hamiltonian vector field are f '(y) and -f '(x). The gradient field gives the direction in which the function is increasing most rapidly. If one treats the function as the Hamiltonian of a mechanical system, the Hamiltonian vector field gives the equations of motion in phase space.



Enter a function of x and y :   " >   

Plot Range :   " >   <= x <=   " >

Plot Range :   " >   <= y <=   " >

<%Mathlet MSPSetDefault[$$funcType, "PlotVectorField"] %> Choose function :

    > Vector Field
    > Gradient Field
    > Hamiltonian Field



<%Mathlet Needs["Graphics`PlotField`"]; %> <%Mathlet MSPBlock[ {$$funcx,$$funcy,$$funcxy, $$begx, $$endx, $$begy, $$endy, $$begxx, $$endxx,$$begyy, $$endyy, $$fr1, $$fr2, $$fr3, $$fr4, $$xAxe, $$yAxe, $$xAxeOrigin, $$yAxeOrigin, $$plotLabel, $$xAxeLabel, $$yAxeLabel, $$xTicks, $$yTicks, $$frame, $$rotateLabel, $$xGrids, $$yGrids, $$aspectRatio, $$rColor, $$gColor, $$bColor, $$rColorBackg, $$gColorBackg, $$bColorBackg, $$imageSize, $$plotPoints }, Switch[$$funcType , "PlotVectorField" , result = PlotVectorField[ {$$funcx,$$funcy}, {x, $$begx, $$endx},{y,$$begy, $$endy}, AspectRatio->If[$$aspectRatioFlag === "Specified" , $$aspectRatio, MSPToExpression[$$aspectRatioFlag]], Axes->{$$xAxe,$$yAxe}, AxesOrigin-> If[$$axesOriginFlag === "Specified", {$$xAxeOrigin,$$yAxeOrigin}, Automatic], AxesLabel->{If[$$xAxeLabel === Null, "", ToString[HoldForm[$$xAxeLabel]]], If[$$yAxeLabel === Null, "", ToString[HoldForm[$$yAxeLabel]]]}, Ticks-> {If[$$xTicksFlag === "Specified" , $$xTicks , MSPToExpression[$$xTicksFlag]], If[$$yTicksFlag === "Specified" , $$yTicks , MSPToExpression[$$yTicksFlag]]}, Frame->$$frame, FrameLabel-> {If[$$fr1 === Null, "", ToString[HoldForm[$$fr1]]], If[$$fr2 === Null, "", ToString[HoldForm[$$fr2]]], If[$$fr3 === Null, "", ToString[HoldForm[$$fr3]]], If[$$fr4 === Null, "", ToString[HoldForm[$$fr4]]]}, RotateLabel->$$rotateLabel, GridLines-> {If[$$xGridsFlag === "Specified" , $$xGrids , MSPToExpression[$$xGridsFlag]], If[$$yGridsFlag === "Specified" , $$yGrids , MSPToExpression[$$yGridsFlag]]}, PlotLabel-> If[$$plotLabel === Null, "", ToString[HoldForm[$$plotLabel]]], DefaultColor->If[{$$rColor,$$gColor,$$bColor} =!= {"","",""}, RGBColor[$$rColor,$$gColor,$$bColor], Automatic], Background-> If[{$$rColorBackg,$$gColorBackg,$$bColorBackg} =!= {"","",""}, RGBColor[$$rColorBackg,$$gColorBackg,$$bColorBackg], Automatic], ImageSize-> If[NumberQ[$$imageSize],$$imageSize,Automatic], PlotPoints->$$plotPoints ], "PlotGradientField" , result = PlotGradientField[ $$funcxy, {x, $$begxx, $$endxx},{y,$$begyy,$$endyy}, AspectRatio->If[$$aspectRatioFlag === "Specified" , $$aspectRatio, MSPToExpression[$$aspectRatioFlag]], Axes->{$$yAxe,$$xAxe}, AxesOrigin-> If[$$axesOriginFlag === "Specified", {$$xAxeOrigin,$$yAxeOrigin}, Automatic], AxesLabel->{If[$$xAxeLabel === Null, "", ToString[HoldForm[$$xAxeLabel]]], If[$$yAxeLabel === Null, "", ToString[HoldForm[$$yAxeLabel]]]}, Ticks-> {If[$$xTicksFlag === "Specified" , $$xTicks , MSPToExpression[$$xTicksFlag]], If[$$yTicksFlag === "Specified" , $$yTicks , MSPToExpression[$$yTicksFlag]]}, Frame->$$frame, FrameLabel-> {If[$$fr1 === Null, "", ToString[HoldForm[$$fr1]]], If[$$fr2 === Null, "", ToString[HoldForm[$$fr2]]], If[$$fr3 === Null, "", ToString[HoldForm[$$fr3]]], If[$$fr4 === Null, "", ToString[HoldForm[$$fr4]]]}, RotateLabel->$$rotateLabel, GridLines-> {If[$$xGridsFlag === "Specified" , $$xGrids , MSPToExpression[$$xGridsFlag]], If[$$yGridsFlag === "Specified" , $$yGrids , MSPToExpression[$$yGridsFlag]]}, PlotLabel-> If[$$plotLabel === Null, "", ToString[HoldForm[$$plotLabel]]], DefaultColor->If[{$$rColor,$$gColor,$$bColor} =!= {"","",""}, RGBColor[$$rColor,$$gColor,$$bColor], Automatic], Background-> If[{$$rColorBackg,$$gColorBackg,$$bColorBackg} =!= {"","",""}, RGBColor[$$rColorBackg,$$gColorBackg,$$bColorBackg], Automatic], ImageSize-> If[NumberQ[$$imageSize],$$imageSize,Automatic], PlotPoints->$$plotPoints ], "PlotHamiltonianField" , result = PlotHamiltonianField[ $$funcxy, {x, $$begxx, $$endxx},{y,$$begyy,$$endyy}, AspectRatio->If[$$aspectRatioFlag === "Specified" , $$aspectRatio, MSPToExpression[$$aspectRatioFlag]], Axes->{$$xAxe,$$yAxe}, AxesOrigin-> If[$$axesOriginFlag === "Specified", {$$xAxeOrigin,$$yAxeOrigin}, Automatic], AxesLabel->{If[$$xAxeLabel === Null, "", ToString[HoldForm[$$xAxeLabel]]], If[$$yAxeLabel === Null, "", ToString[HoldForm[$$yAxeLabel]]]}, Ticks-> {If[$$xTicksFlag === "Specified" , $$xTicks , MSPToExpression[$$xTicksFlag]], If[$$yTicksFlag === "Specified" , $$yTicks , MSPToExpression[$$yTicksFlag]]}, Frame->$$frame, FrameLabel-> {If[$$fr1 === Null, "", ToString[HoldForm[$$fr1]]], If[$$fr2 === Null, "", ToString[HoldForm[$$fr2]]], If[$$fr3 === Null, "", ToString[HoldForm[$$fr3]]], If[$$fr4 === Null, "", ToString[HoldForm[$$fr4]]]}, RotateLabel->$$rotateLabel, GridLines-> {If[$$xGridsFlag === "Specified" , $$xGrids , MSPToExpression[$$xGridsFlag]], If[$$yGridsFlag === "Specified" , $$yGrids , MSPToExpression[$$yGridsFlag]]}, PlotLabel-> If[$$plotLabel === Null, "", ToString[HoldForm[$$plotLabel]]], DefaultColor->If[{$$rColor,$$gColor,$$bColor} =!= {"","",""}, RGBColor[$$rColor,$$gColor,$$bColor], Automatic], Background-> If[{$$rColorBackg,$$gColorBackg,$$bColorBackg} =!= {"","",""}, RGBColor[$$rColorBackg,$$gColorBackg,$$bColorBackg], Automatic], ImageSize-> If[NumberQ[$$imageSize],$$imageSize,Automatic], PlotPoints->$$plotPoints ] ]; If[Head[result] === Graphics, MSPShow[result] ] ] %> <%Mathlet MSPBlock[{$$fname, $$submitButton1}, c = If[$$fname === Null, "", ToString[$$fname]]; ftype = Switch[$$opt, "jpg", "JPEG", "tif", "TIFF", "eps", "EPSTIFF", "xbm", "XBitmap", "mps", "MPS", _ , $$opt]; If[Head[result] === Graphics, MSPReturn[DisplayString[result, ftype], "image/"<>ftype , c<>"."<>$$opt] ] ] %>

Save as: 

With file name:   " >


General options

<%Mathlet MSPSetDefault[$$xAxe, "True"] %> <%Mathlet MSPSetDefault[$$yAxe, "True"] %> Axes:  X:  > True   > False      Y:  > True   > False

<%Mathlet MSPSetDefault[$$axesOriginFlag, "Automatic"] %> Axes origin : > Automatic > Specified    X : " >    Y : " >

Axes labels:   x label:  " >   y label:  " >

<%Mathlet MSPSetDefault[$$xTicksFlag, "Automatic"] %> <%Mathlet MSPSetDefault[$$yTicksFlag, "Automatic"] %> Ticks:
Whether to draw tick marks if there are axes. You may specify the positions at which ticks will be drawn.

X:  > Automatic   > None   > Specified:   " > (list of values)

Y:  > Automatic   > None   > Specified:   " > (list of values)

<%Mathlet MSPSetDefault[$$frame, "False"] ;%> Frame :   > False   > True

Frame labels:

Frame label down:   " >   Frame label left:   " >

Frame label up:   " >   Frame label right:   " >

<%Mathlet MSPSetDefault[$$rotateLabel, "True"] %> Rotate labels : > True     > False   (whether to allow text in frame labels to be vertically positioned)

<%Mathlet MSPSetDefault[$$xGridsFlag, "None"] %> <%Mathlet MSPSetDefault[$$yGridsFlag, "None"] %> Gridlines:
Whether to draw gridlines. You may specify the positions at which gridlines will be drawn.

X:  > None   > Automatic   > Specified:   " > (list of values)

Y:  > None   > Automatic   > Specified:   " > (list of values)

Plot label:  " >

<%Mathlet MSPSetDefault[$$aspectRatioFlag, "1/GoldenRatio"] %> Aspect ratio :   > Default > Automatic > Specified :   " >
Setting the AspectRatio option changes the whole shape of your plot. AspectRatio gives the ratio of height to width.
Its default value is the inverse of the Golden Ratio — supposedly the most pleasing shape for a rectangle.
Automatic determines the shape of the display area from the original coordinate system.



<%Mathlet MSPSetDefault[$$plotPoints, "15"] %> Plot points :   " >   (the minimum number of points at which to sample the function)

Plot color (RGB color):  red part :  " >   green part :  " >   blue part :  " >
Specifies the default color to be used for axes, frames and bounds of the figure. The values of the color parts must be between 0 and 1.

Background (RGB color):  red part :  " >   green part :  " >   blue part :  " >

Image size:   ">   specifies that the image should have a width of x printer's points

  
© 2004 webComputing,   Scientific Visualization