Wolfram Research

Function Repository Resource:

FunctionPeriodPlot (1.0.0) current version: 2.0.0 »

Source Notebook

Plot a given number of periods of a periodic function

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["FunctionPeriodPlot"][f,x]

plots one period of a periodic function f of x.

ResourceFunction["FunctionPeriodPlot"][f,x,n]

plots n periods of a periodic function f of x.

Details and Options

The function to plot, f, is expected to be periodic in the variable x.
"PeriodAlignment"Centerdetermine where to align the period relative to the starting point using the values Left,Right or Center
"StartingPoint"0where to start plotting period
ResourceFunction["FunctionPeriodPlot"] also takes all options of Plot.
The options "StartingPoint" and "PeriodAlignment" work in tandem to determine the plot.

Examples

Basic Examples (1) 

Plot a single period of a periodic function:

In[1]:=
ResourceFunction["FunctionPeriodPlot"][Sin[x], x]
Out[1]=

Scope (1) 

Plot two periods of a periodic function:

In[2]:=
ResourceFunction["FunctionPeriodPlot"][Tan[x], x, 2]
Out[2]=

Options (1) 

Use "StartingPoint" to determine the base point and "PeriodAlignment" to determine whether to plot the period(s) centered around that point, to the right of that point or to the left of that point:

In[3]:=
Table[Labeled[
  ResourceFunction["FunctionPeriodPlot"][Sin[x], x, 2, "StartingPoint" -> Pi/2, "PeriodAlignment" -> place], place], {place, {Center, Right, Left}}]
Out[3]=

Possible Issues (1) 

FunctionPeriodPlot returns unevaluated when the input expression is not periodic:

In[4]:=
ResourceFunction["FunctionPeriodPlot"][x^2, x]
Out[4]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.0 – 26 October 2020

Related Resources

Author Notes

To view the full source code for FunctionPeriodPlot, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "FunctionPeriodPlot.wl"}]]

License Information