Wolfram Research

Function Repository Resource:

ManipulatePlot

Source Notebook

Generate a plot in which the plot ranges and function parameters can be manipulated dynamically

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["ManipulatePlot"][expr,{x,lo,hi},{a,min,max},]

returns a manipulable plot of expr on the domain loxhi with symbolic parameters varying on the given domains.

ResourceFunction["ManipulatePlot"][{expr1,expr2,},]

returns a manipulable plot of all of the expri.

Details and Options

ResourceFunction["ManipulatePlot"] has syntax that merges those of Manipulate and Plot where the independent variable for plotting x, along with its bounds, forms the second argument. Subsequent parameters become Manipulate variables.
ResourceFunction["ManipulatePlot"] takes the options of both Manipulate and Plot.
Both the horizontal and vertical plot ranges are adjustable in the generated plot.

Examples

Basic Examples

Plot a basic function allowing manipulation of the parameters and plot range:

In[1]:=
ResourceFunction["ManipulatePlot"][
 Sin[a*x], {x, -\[Pi], \[Pi]}, {a, -1, 1}]
Out[1]=

Scope

Initialize a parameter using Manipulate syntax:

In[2]:=
ResourceFunction["ManipulatePlot"][
 Sin[a*x], {x, -\[Pi], \[Pi]}, {{a, 1/2}, -1, 1}]
Out[2]=

ManipulatePlot can support multiple curves and take many parameters:

In[3]:=
ResourceFunction[
 "ManipulatePlot"][{c Sin[b*x] + a Cos[b*x], Sin[a x]},  {x, -2 Pi, 2 Pi}, {{a, 1}, -1, 2}, {{b, 1}, -4, 4}, {{c, 3}, -1, 5}]
Out[3]=

Options

ManipulatePlot accepts options for both Plot and Manipulate:

In[4]:=
ResourceFunction["ManipulatePlot"][
 Sin[a*x], {x, -\[Pi], \[Pi]}, {{a, 1/2}, -1, 1}, PlotTheme -> "Business"]
Out[4]=

Resource History

Related Resources

License Information