Function Repository Resource:

# SuggestPlotRange

Get a variable range against which to plot a given function

Contributed by: Wolfram|Alpha Math Team
 ResourceFunction["SuggestPlotRange"][expr,x] tries to return a range in x that will produce a nice-looking plot of the expression expr versus x.

## Details and Options

ResourceFunction["SuggestPlotRange"][expr, x] returns a result of the form {x, xmin, xmax} that can be used directly as a range specifier in Plot.
ResourceFunction["SuggestPlotRange"] takes the following options:
 "Periods" Automatic how many periods of a periodic function to plot "Range" "Narrow" whether to give a "Narrow" or "Wide" plot range

## Examples

### Basic Examples (5)

Suggest a plot range for a trigonometric function:

 In[1]:=
 Out[2]=
 In[3]:=
 Out[3]=

Suggest a plot range for a polynomial function:

 In[4]:=
 Out[5]=
 In[6]:=
 Out[6]=

Suggest a plot range for a rational function:

 In[7]:=
 Out[8]=
 In[9]:=
 Out[9]=

Suggest a plot range for a generic function:

 In[10]:=
 Out[11]=
 In[12]:=
 Out[12]=

Suggest a plot range for another function:

 In[13]:=
 Out[14]=
 In[15]:=
 Out[15]=

### Options (2)

Using the option setting Range -> "Wide" will give a range showing more of the function but possibly revealing less detail:

 In[16]:=
 Out[17]=
 In[18]:=
 Out[18]=
 In[19]:=
 Out[19]=
 In[20]:=
 Out[20]=

For periodic functions, the option setting "Periods"n will return a range covering the specified number of periods:

 In[21]:=
 Out[22]=
 In[23]:=
 Out[23]=

## Publisher

Wolfram|Alpha Math Team

## Version History

• 6.0.0 – 23 March 2023
• 5.1.0 – 12 May 2021
• 5.0.0 – 24 January 2020
• 4.0.0 – 10 September 2019
• 3.0.0 – 06 September 2019
• 2.0.0 – 12 June 2019
• 1.0.0 – 22 February 2019